From b3c661d3977cb90718e658f676d3b5d762259a90 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 4 Jun 2013 11:15:29 +1000 Subject: [PATCH] Switch tools to use libevdev_get_event_*_name interface Signed-off-by: Peter Hutterer --- tools/Makefile.am | 2 +- tools/event-names.h | 704 ------------------------------------------------ tools/libevdev-events.c | 14 +- 3 files changed, 8 insertions(+), 712 deletions(-) delete mode 100644 tools/event-names.h diff --git a/tools/Makefile.am b/tools/Makefile.am index 500720e..931a7d2 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -3,6 +3,6 @@ noinst_PROGRAMS = libevdev-events AM_CPPFLAGS = -I$(top_srcdir)/libevdev libevdev_ldadd = $(top_builddir)/libevdev/libevdev.la -libevdev_events_SOURCES = libevdev-events.c event-names.h +libevdev_events_SOURCES = libevdev-events.c libevdev_events_LDADD = $(libevdev_ldadd) diff --git a/tools/event-names.h b/tools/event-names.h deleted file mode 100644 index c687ba8..0000000 --- a/tools/event-names.h +++ /dev/null @@ -1,704 +0,0 @@ -/* THIS FILE IS GENERATED, DO NOT EDIT */ -/* to regenerate this file, get evemu from - git://git.freedesktop.org/git/evemu - */ - -#ifndef EVENT_NAMES_H -#define EVENT_NAMES_H - -#define SYN_MAX 3 /* linux/input.h doesn't define that */ - -static const char * const ev_map[EV_MAX + 1] = { - [0 ... EV_MAX] = NULL, - [EV_SYN] = "EV_SYN", - [EV_KEY] = "EV_KEY", - [EV_REL] = "EV_REL", - [EV_ABS] = "EV_ABS", - [EV_MSC] = "EV_MSC", - [EV_SW] = "EV_SW", - [EV_LED] = "EV_LED", - [EV_SND] = "EV_SND", - [EV_REP] = "EV_REP", - [EV_FF] = "EV_FF", - [EV_PWR] = "EV_PWR", - [EV_FF_STATUS] = "EV_FF_STATUS", - [EV_MAX] = "EV_MAX", -}; - -static const char * const rel_map[REL_MAX + 1] = { - [0 ... REL_MAX] = NULL, - [REL_X] = "REL_X", - [REL_Y] = "REL_Y", - [REL_Z] = "REL_Z", - [REL_RX] = "REL_RX", - [REL_RY] = "REL_RY", - [REL_RZ] = "REL_RZ", - [REL_HWHEEL] = "REL_HWHEEL", - [REL_DIAL] = "REL_DIAL", - [REL_WHEEL] = "REL_WHEEL", - [REL_MISC] = "REL_MISC", - [REL_MAX] = "REL_MAX", -}; - -static const char * const abs_map[ABS_MAX + 1] = { - [0 ... ABS_MAX] = NULL, - [ABS_X] = "ABS_X", - [ABS_Y] = "ABS_Y", - [ABS_Z] = "ABS_Z", - [ABS_RX] = "ABS_RX", - [ABS_RY] = "ABS_RY", - [ABS_RZ] = "ABS_RZ", - [ABS_THROTTLE] = "ABS_THROTTLE", - [ABS_RUDDER] = "ABS_RUDDER", - [ABS_WHEEL] = "ABS_WHEEL", - [ABS_GAS] = "ABS_GAS", - [ABS_BRAKE] = "ABS_BRAKE", - [ABS_HAT0X] = "ABS_HAT0X", - [ABS_HAT0Y] = "ABS_HAT0Y", - [ABS_HAT1X] = "ABS_HAT1X", - [ABS_HAT1Y] = "ABS_HAT1Y", - [ABS_HAT2X] = "ABS_HAT2X", - [ABS_HAT2Y] = "ABS_HAT2Y", - [ABS_HAT3X] = "ABS_HAT3X", - [ABS_HAT3Y] = "ABS_HAT3Y", - [ABS_PRESSURE] = "ABS_PRESSURE", - [ABS_DISTANCE] = "ABS_DISTANCE", - [ABS_TILT_X] = "ABS_TILT_X", - [ABS_TILT_Y] = "ABS_TILT_Y", - [ABS_TOOL_WIDTH] = "ABS_TOOL_WIDTH", - [ABS_VOLUME] = "ABS_VOLUME", - [ABS_MISC] = "ABS_MISC", - [ABS_MT_SLOT] = "ABS_MT_SLOT", - [ABS_MT_TOUCH_MAJOR] = "ABS_MT_TOUCH_MAJOR", - [ABS_MT_TOUCH_MINOR] = "ABS_MT_TOUCH_MINOR", - [ABS_MT_WIDTH_MAJOR] = "ABS_MT_WIDTH_MAJOR", - [ABS_MT_WIDTH_MINOR] = "ABS_MT_WIDTH_MINOR", - [ABS_MT_ORIENTATION] = "ABS_MT_ORIENTATION", - [ABS_MT_POSITION_X] = "ABS_MT_POSITION_X", - [ABS_MT_POSITION_Y] = "ABS_MT_POSITION_Y", - [ABS_MT_TOOL_TYPE] = "ABS_MT_TOOL_TYPE", - [ABS_MT_BLOB_ID] = "ABS_MT_BLOB_ID", - [ABS_MT_TRACKING_ID] = "ABS_MT_TRACKING_ID", - [ABS_MT_PRESSURE] = "ABS_MT_PRESSURE", - [ABS_MT_DISTANCE] = "ABS_MT_DISTANCE", - [ABS_MT_TOOL_X] = "ABS_MT_TOOL_X", - [ABS_MT_TOOL_Y] = "ABS_MT_TOOL_Y", - [ABS_MAX] = "ABS_MAX", -}; - -static const char * const key_map[KEY_MAX + 1] = { - [0 ... KEY_MAX] = NULL, - [KEY_RESERVED] = "KEY_RESERVED", - [KEY_ESC] = "KEY_ESC", - [KEY_1] = "KEY_1", - [KEY_2] = "KEY_2", - [KEY_3] = "KEY_3", - [KEY_4] = "KEY_4", - [KEY_5] = "KEY_5", - [KEY_6] = "KEY_6", - [KEY_7] = "KEY_7", - [KEY_8] = "KEY_8", - [KEY_9] = "KEY_9", - [KEY_0] = "KEY_0", - [KEY_MINUS] = "KEY_MINUS", - [KEY_EQUAL] = "KEY_EQUAL", - [KEY_BACKSPACE] = "KEY_BACKSPACE", - [KEY_TAB] = "KEY_TAB", - [KEY_Q] = "KEY_Q", - [KEY_W] = "KEY_W", - [KEY_E] = "KEY_E", - [KEY_R] = "KEY_R", - [KEY_T] = "KEY_T", - [KEY_Y] = "KEY_Y", - [KEY_U] = "KEY_U", - [KEY_I] = "KEY_I", - [KEY_O] = "KEY_O", - [KEY_P] = "KEY_P", - [KEY_LEFTBRACE] = "KEY_LEFTBRACE", - [KEY_RIGHTBRACE] = "KEY_RIGHTBRACE", - [KEY_ENTER] = "KEY_ENTER", - [KEY_LEFTCTRL] = "KEY_LEFTCTRL", - [KEY_A] = "KEY_A", - [KEY_S] = "KEY_S", - [KEY_D] = "KEY_D", - [KEY_F] = "KEY_F", - [KEY_G] = "KEY_G", - [KEY_H] = "KEY_H", - [KEY_J] = "KEY_J", - [KEY_K] = "KEY_K", - [KEY_L] = "KEY_L", - [KEY_SEMICOLON] = "KEY_SEMICOLON", - [KEY_APOSTROPHE] = "KEY_APOSTROPHE", - [KEY_GRAVE] = "KEY_GRAVE", - [KEY_LEFTSHIFT] = "KEY_LEFTSHIFT", - [KEY_BACKSLASH] = "KEY_BACKSLASH", - [KEY_Z] = "KEY_Z", - [KEY_X] = "KEY_X", - [KEY_C] = "KEY_C", - [KEY_V] = "KEY_V", - [KEY_B] = "KEY_B", - [KEY_N] = "KEY_N", - [KEY_M] = "KEY_M", - [KEY_COMMA] = "KEY_COMMA", - [KEY_DOT] = "KEY_DOT", - [KEY_SLASH] = "KEY_SLASH", - [KEY_RIGHTSHIFT] = "KEY_RIGHTSHIFT", - [KEY_KPASTERISK] = "KEY_KPASTERISK", - [KEY_LEFTALT] = "KEY_LEFTALT", - [KEY_SPACE] = "KEY_SPACE", - [KEY_CAPSLOCK] = "KEY_CAPSLOCK", - [KEY_F1] = "KEY_F1", - [KEY_F2] = "KEY_F2", - [KEY_F3] = "KEY_F3", - [KEY_F4] = "KEY_F4", - [KEY_F5] = "KEY_F5", - [KEY_F6] = "KEY_F6", - [KEY_F7] = "KEY_F7", - [KEY_F8] = "KEY_F8", - [KEY_F9] = "KEY_F9", - [KEY_F10] = "KEY_F10", - [KEY_NUMLOCK] = "KEY_NUMLOCK", - [KEY_SCROLLLOCK] = "KEY_SCROLLLOCK", - [KEY_KP7] = "KEY_KP7", - [KEY_KP8] = "KEY_KP8", - [KEY_KP9] = "KEY_KP9", - [KEY_KPMINUS] = "KEY_KPMINUS", - [KEY_KP4] = "KEY_KP4", - [KEY_KP5] = "KEY_KP5", - [KEY_KP6] = "KEY_KP6", - [KEY_KPPLUS] = "KEY_KPPLUS", - [KEY_KP1] = "KEY_KP1", - [KEY_KP2] = "KEY_KP2", - [KEY_KP3] = "KEY_KP3", - [KEY_KP0] = "KEY_KP0", - [KEY_KPDOT] = "KEY_KPDOT", - [KEY_ZENKAKUHANKAKU] = "KEY_ZENKAKUHANKAKU", - [KEY_102ND] = "KEY_102ND", - [KEY_F11] = "KEY_F11", - [KEY_F12] = "KEY_F12", - [KEY_RO] = "KEY_RO", - [KEY_KATAKANA] = "KEY_KATAKANA", - [KEY_HIRAGANA] = "KEY_HIRAGANA", - [KEY_HENKAN] = "KEY_HENKAN", - [KEY_KATAKANAHIRAGANA] = "KEY_KATAKANAHIRAGANA", - [KEY_MUHENKAN] = "KEY_MUHENKAN", - [KEY_KPJPCOMMA] = "KEY_KPJPCOMMA", - [KEY_KPENTER] = "KEY_KPENTER", - [KEY_RIGHTCTRL] = "KEY_RIGHTCTRL", - [KEY_KPSLASH] = "KEY_KPSLASH", - [KEY_SYSRQ] = "KEY_SYSRQ", - [KEY_RIGHTALT] = "KEY_RIGHTALT", - [KEY_LINEFEED] = "KEY_LINEFEED", - [KEY_HOME] = "KEY_HOME", - [KEY_UP] = "KEY_UP", - [KEY_PAGEUP] = "KEY_PAGEUP", - [KEY_LEFT] = "KEY_LEFT", - [KEY_RIGHT] = "KEY_RIGHT", - [KEY_END] = "KEY_END", - [KEY_DOWN] = "KEY_DOWN", - [KEY_PAGEDOWN] = "KEY_PAGEDOWN", - [KEY_INSERT] = "KEY_INSERT", - [KEY_DELETE] = "KEY_DELETE", - [KEY_MACRO] = "KEY_MACRO", - [KEY_MUTE] = "KEY_MUTE", - [KEY_VOLUMEDOWN] = "KEY_VOLUMEDOWN", - [KEY_VOLUMEUP] = "KEY_VOLUMEUP", - [KEY_POWER] = "KEY_POWER", - [KEY_KPEQUAL] = "KEY_KPEQUAL", - [KEY_KPPLUSMINUS] = "KEY_KPPLUSMINUS", - [KEY_PAUSE] = "KEY_PAUSE", - [KEY_SCALE] = "KEY_SCALE", - [KEY_KPCOMMA] = "KEY_KPCOMMA", - [KEY_HANGEUL] = "KEY_HANGEUL", - [KEY_HANJA] = "KEY_HANJA", - [KEY_YEN] = "KEY_YEN", - [KEY_LEFTMETA] = "KEY_LEFTMETA", - [KEY_RIGHTMETA] = "KEY_RIGHTMETA", - [KEY_COMPOSE] = "KEY_COMPOSE", - [KEY_STOP] = "KEY_STOP", - [KEY_AGAIN] = "KEY_AGAIN", - [KEY_PROPS] = "KEY_PROPS", - [KEY_UNDO] = "KEY_UNDO", - [KEY_FRONT] = "KEY_FRONT", - [KEY_COPY] = "KEY_COPY", - [KEY_OPEN] = "KEY_OPEN", - [KEY_PASTE] = "KEY_PASTE", - [KEY_FIND] = "KEY_FIND", - [KEY_CUT] = "KEY_CUT", - [KEY_HELP] = "KEY_HELP", - [KEY_MENU] = "KEY_MENU", - [KEY_CALC] = "KEY_CALC", - [KEY_SETUP] = "KEY_SETUP", - [KEY_SLEEP] = "KEY_SLEEP", - [KEY_WAKEUP] = "KEY_WAKEUP", - [KEY_FILE] = "KEY_FILE", - [KEY_SENDFILE] = "KEY_SENDFILE", - [KEY_DELETEFILE] = "KEY_DELETEFILE", - [KEY_XFER] = "KEY_XFER", - [KEY_PROG1] = "KEY_PROG1", - [KEY_PROG2] = "KEY_PROG2", - [KEY_WWW] = "KEY_WWW", - [KEY_MSDOS] = "KEY_MSDOS", - [KEY_COFFEE] = "KEY_COFFEE", - [KEY_DIRECTION] = "KEY_DIRECTION", - [KEY_CYCLEWINDOWS] = "KEY_CYCLEWINDOWS", - [KEY_MAIL] = "KEY_MAIL", - [KEY_BOOKMARKS] = "KEY_BOOKMARKS", - [KEY_COMPUTER] = "KEY_COMPUTER", - [KEY_BACK] = "KEY_BACK", - [KEY_FORWARD] = "KEY_FORWARD", - [KEY_CLOSECD] = "KEY_CLOSECD", - [KEY_EJECTCD] = "KEY_EJECTCD", - [KEY_EJECTCLOSECD] = "KEY_EJECTCLOSECD", - [KEY_NEXTSONG] = "KEY_NEXTSONG", - [KEY_PLAYPAUSE] = "KEY_PLAYPAUSE", - [KEY_PREVIOUSSONG] = "KEY_PREVIOUSSONG", - [KEY_STOPCD] = "KEY_STOPCD", - [KEY_RECORD] = "KEY_RECORD", - [KEY_REWIND] = "KEY_REWIND", - [KEY_PHONE] = "KEY_PHONE", - [KEY_ISO] = "KEY_ISO", - [KEY_CONFIG] = "KEY_CONFIG", - [KEY_HOMEPAGE] = "KEY_HOMEPAGE", - [KEY_REFRESH] = "KEY_REFRESH", - [KEY_EXIT] = "KEY_EXIT", - [KEY_MOVE] = "KEY_MOVE", - [KEY_EDIT] = "KEY_EDIT", - [KEY_SCROLLUP] = "KEY_SCROLLUP", - [KEY_SCROLLDOWN] = "KEY_SCROLLDOWN", - [KEY_KPLEFTPAREN] = "KEY_KPLEFTPAREN", - [KEY_KPRIGHTPAREN] = "KEY_KPRIGHTPAREN", - [KEY_NEW] = "KEY_NEW", - [KEY_REDO] = "KEY_REDO", - [KEY_F13] = "KEY_F13", - [KEY_F14] = "KEY_F14", - [KEY_F15] = "KEY_F15", - [KEY_F16] = "KEY_F16", - [KEY_F17] = "KEY_F17", - [KEY_F18] = "KEY_F18", - [KEY_F19] = "KEY_F19", - [KEY_F20] = "KEY_F20", - [KEY_F21] = "KEY_F21", - [KEY_F22] = "KEY_F22", - [KEY_F23] = "KEY_F23", - [KEY_F24] = "KEY_F24", - [KEY_PLAYCD] = "KEY_PLAYCD", - [KEY_PAUSECD] = "KEY_PAUSECD", - [KEY_PROG3] = "KEY_PROG3", - [KEY_PROG4] = "KEY_PROG4", - [KEY_DASHBOARD] = "KEY_DASHBOARD", - [KEY_SUSPEND] = "KEY_SUSPEND", - [KEY_CLOSE] = "KEY_CLOSE", - [KEY_PLAY] = "KEY_PLAY", - [KEY_FASTFORWARD] = "KEY_FASTFORWARD", - [KEY_BASSBOOST] = "KEY_BASSBOOST", - [KEY_PRINT] = "KEY_PRINT", - [KEY_HP] = "KEY_HP", - [KEY_CAMERA] = "KEY_CAMERA", - [KEY_SOUND] = "KEY_SOUND", - [KEY_QUESTION] = "KEY_QUESTION", - [KEY_EMAIL] = "KEY_EMAIL", - [KEY_CHAT] = "KEY_CHAT", - [KEY_SEARCH] = "KEY_SEARCH", - [KEY_CONNECT] = "KEY_CONNECT", - [KEY_FINANCE] = "KEY_FINANCE", - [KEY_SPORT] = "KEY_SPORT", - [KEY_SHOP] = "KEY_SHOP", - [KEY_ALTERASE] = "KEY_ALTERASE", - [KEY_CANCEL] = "KEY_CANCEL", - [KEY_BRIGHTNESSDOWN] = "KEY_BRIGHTNESSDOWN", - [KEY_BRIGHTNESSUP] = "KEY_BRIGHTNESSUP", - [KEY_MEDIA] = "KEY_MEDIA", - [KEY_SWITCHVIDEOMODE] = "KEY_SWITCHVIDEOMODE", - [KEY_KBDILLUMTOGGLE] = "KEY_KBDILLUMTOGGLE", - [KEY_KBDILLUMDOWN] = "KEY_KBDILLUMDOWN", - [KEY_KBDILLUMUP] = "KEY_KBDILLUMUP", - [KEY_SEND] = "KEY_SEND", - [KEY_REPLY] = "KEY_REPLY", - [KEY_FORWARDMAIL] = "KEY_FORWARDMAIL", - [KEY_SAVE] = "KEY_SAVE", - [KEY_DOCUMENTS] = "KEY_DOCUMENTS", - [KEY_BATTERY] = "KEY_BATTERY", - [KEY_BLUETOOTH] = "KEY_BLUETOOTH", - [KEY_WLAN] = "KEY_WLAN", - [KEY_UWB] = "KEY_UWB", - [KEY_UNKNOWN] = "KEY_UNKNOWN", - [KEY_VIDEO_NEXT] = "KEY_VIDEO_NEXT", - [KEY_VIDEO_PREV] = "KEY_VIDEO_PREV", - [KEY_BRIGHTNESS_CYCLE] = "KEY_BRIGHTNESS_CYCLE", - [KEY_BRIGHTNESS_ZERO] = "KEY_BRIGHTNESS_ZERO", - [KEY_DISPLAY_OFF] = "KEY_DISPLAY_OFF", - [KEY_WIMAX] = "KEY_WIMAX", - [KEY_RFKILL] = "KEY_RFKILL", - [KEY_MICMUTE] = "KEY_MICMUTE", - [BTN_0] = "BTN_0", - [BTN_1] = "BTN_1", - [BTN_2] = "BTN_2", - [BTN_3] = "BTN_3", - [BTN_4] = "BTN_4", - [BTN_5] = "BTN_5", - [BTN_6] = "BTN_6", - [BTN_7] = "BTN_7", - [BTN_8] = "BTN_8", - [BTN_9] = "BTN_9", - [BTN_LEFT] = "BTN_LEFT", - [BTN_RIGHT] = "BTN_RIGHT", - [BTN_MIDDLE] = "BTN_MIDDLE", - [BTN_SIDE] = "BTN_SIDE", - [BTN_EXTRA] = "BTN_EXTRA", - [BTN_FORWARD] = "BTN_FORWARD", - [BTN_BACK] = "BTN_BACK", - [BTN_TASK] = "BTN_TASK", - [BTN_TRIGGER] = "BTN_TRIGGER", - [BTN_THUMB] = "BTN_THUMB", - [BTN_THUMB2] = "BTN_THUMB2", - [BTN_TOP] = "BTN_TOP", - [BTN_TOP2] = "BTN_TOP2", - [BTN_PINKIE] = "BTN_PINKIE", - [BTN_BASE] = "BTN_BASE", - [BTN_BASE2] = "BTN_BASE2", - [BTN_BASE3] = "BTN_BASE3", - [BTN_BASE4] = "BTN_BASE4", - [BTN_BASE5] = "BTN_BASE5", - [BTN_BASE6] = "BTN_BASE6", - [BTN_DEAD] = "BTN_DEAD", - [BTN_A] = "BTN_A", - [BTN_B] = "BTN_B", - [BTN_C] = "BTN_C", - [BTN_X] = "BTN_X", - [BTN_Y] = "BTN_Y", - [BTN_Z] = "BTN_Z", - [BTN_TL] = "BTN_TL", - [BTN_TR] = "BTN_TR", - [BTN_TL2] = "BTN_TL2", - [BTN_TR2] = "BTN_TR2", - [BTN_SELECT] = "BTN_SELECT", - [BTN_START] = "BTN_START", - [BTN_MODE] = "BTN_MODE", - [BTN_THUMBL] = "BTN_THUMBL", - [BTN_THUMBR] = "BTN_THUMBR", - [BTN_TOOL_PEN] = "BTN_TOOL_PEN", - [BTN_TOOL_RUBBER] = "BTN_TOOL_RUBBER", - [BTN_TOOL_BRUSH] = "BTN_TOOL_BRUSH", - [BTN_TOOL_PENCIL] = "BTN_TOOL_PENCIL", - [BTN_TOOL_AIRBRUSH] = "BTN_TOOL_AIRBRUSH", - [BTN_TOOL_FINGER] = "BTN_TOOL_FINGER", - [BTN_TOOL_MOUSE] = "BTN_TOOL_MOUSE", - [BTN_TOOL_LENS] = "BTN_TOOL_LENS", - [BTN_TOOL_QUINTTAP] = "BTN_TOOL_QUINTTAP", - [BTN_TOUCH] = "BTN_TOUCH", - [BTN_STYLUS] = "BTN_STYLUS", - [BTN_STYLUS2] = "BTN_STYLUS2", - [BTN_TOOL_DOUBLETAP] = "BTN_TOOL_DOUBLETAP", - [BTN_TOOL_TRIPLETAP] = "BTN_TOOL_TRIPLETAP", - [BTN_TOOL_QUADTAP] = "BTN_TOOL_QUADTAP", - [BTN_GEAR_DOWN] = "BTN_GEAR_DOWN", - [BTN_GEAR_UP] = "BTN_GEAR_UP", - [KEY_OK] = "KEY_OK", - [KEY_SELECT] = "KEY_SELECT", - [KEY_GOTO] = "KEY_GOTO", - [KEY_CLEAR] = "KEY_CLEAR", - [KEY_POWER2] = "KEY_POWER2", - [KEY_OPTION] = "KEY_OPTION", - [KEY_INFO] = "KEY_INFO", - [KEY_TIME] = "KEY_TIME", - [KEY_VENDOR] = "KEY_VENDOR", - [KEY_ARCHIVE] = "KEY_ARCHIVE", - [KEY_PROGRAM] = "KEY_PROGRAM", - [KEY_CHANNEL] = "KEY_CHANNEL", - [KEY_FAVORITES] = "KEY_FAVORITES", - [KEY_EPG] = "KEY_EPG", - [KEY_PVR] = "KEY_PVR", - [KEY_MHP] = "KEY_MHP", - [KEY_LANGUAGE] = "KEY_LANGUAGE", - [KEY_TITLE] = "KEY_TITLE", - [KEY_SUBTITLE] = "KEY_SUBTITLE", - [KEY_ANGLE] = "KEY_ANGLE", - [KEY_ZOOM] = "KEY_ZOOM", - [KEY_MODE] = "KEY_MODE", - [KEY_KEYBOARD] = "KEY_KEYBOARD", - [KEY_SCREEN] = "KEY_SCREEN", - [KEY_PC] = "KEY_PC", - [KEY_TV] = "KEY_TV", - [KEY_TV2] = "KEY_TV2", - [KEY_VCR] = "KEY_VCR", - [KEY_VCR2] = "KEY_VCR2", - [KEY_SAT] = "KEY_SAT", - [KEY_SAT2] = "KEY_SAT2", - [KEY_CD] = "KEY_CD", - [KEY_TAPE] = "KEY_TAPE", - [KEY_RADIO] = "KEY_RADIO", - [KEY_TUNER] = "KEY_TUNER", - [KEY_PLAYER] = "KEY_PLAYER", - [KEY_TEXT] = "KEY_TEXT", - [KEY_DVD] = "KEY_DVD", - [KEY_AUX] = "KEY_AUX", - [KEY_MP3] = "KEY_MP3", - [KEY_AUDIO] = "KEY_AUDIO", - [KEY_VIDEO] = "KEY_VIDEO", - [KEY_DIRECTORY] = "KEY_DIRECTORY", - [KEY_LIST] = "KEY_LIST", - [KEY_MEMO] = "KEY_MEMO", - [KEY_CALENDAR] = "KEY_CALENDAR", - [KEY_RED] = "KEY_RED", - [KEY_GREEN] = "KEY_GREEN", - [KEY_YELLOW] = "KEY_YELLOW", - [KEY_BLUE] = "KEY_BLUE", - [KEY_CHANNELUP] = "KEY_CHANNELUP", - [KEY_CHANNELDOWN] = "KEY_CHANNELDOWN", - [KEY_FIRST] = "KEY_FIRST", - [KEY_LAST] = "KEY_LAST", - [KEY_AB] = "KEY_AB", - [KEY_NEXT] = "KEY_NEXT", - [KEY_RESTART] = "KEY_RESTART", - [KEY_SLOW] = "KEY_SLOW", - [KEY_SHUFFLE] = "KEY_SHUFFLE", - [KEY_BREAK] = "KEY_BREAK", - [KEY_PREVIOUS] = "KEY_PREVIOUS", - [KEY_DIGITS] = "KEY_DIGITS", - [KEY_TEEN] = "KEY_TEEN", - [KEY_TWEN] = "KEY_TWEN", - [KEY_VIDEOPHONE] = "KEY_VIDEOPHONE", - [KEY_GAMES] = "KEY_GAMES", - [KEY_ZOOMIN] = "KEY_ZOOMIN", - [KEY_ZOOMOUT] = "KEY_ZOOMOUT", - [KEY_ZOOMRESET] = "KEY_ZOOMRESET", - [KEY_WORDPROCESSOR] = "KEY_WORDPROCESSOR", - [KEY_EDITOR] = "KEY_EDITOR", - [KEY_SPREADSHEET] = "KEY_SPREADSHEET", - [KEY_GRAPHICSEDITOR] = "KEY_GRAPHICSEDITOR", - [KEY_PRESENTATION] = "KEY_PRESENTATION", - [KEY_DATABASE] = "KEY_DATABASE", - [KEY_NEWS] = "KEY_NEWS", - [KEY_VOICEMAIL] = "KEY_VOICEMAIL", - [KEY_ADDRESSBOOK] = "KEY_ADDRESSBOOK", - [KEY_MESSENGER] = "KEY_MESSENGER", - [KEY_DISPLAYTOGGLE] = "KEY_DISPLAYTOGGLE", - [KEY_SPELLCHECK] = "KEY_SPELLCHECK", - [KEY_LOGOFF] = "KEY_LOGOFF", - [KEY_DOLLAR] = "KEY_DOLLAR", - [KEY_EURO] = "KEY_EURO", - [KEY_FRAMEBACK] = "KEY_FRAMEBACK", - [KEY_FRAMEFORWARD] = "KEY_FRAMEFORWARD", - [KEY_CONTEXT_MENU] = "KEY_CONTEXT_MENU", - [KEY_MEDIA_REPEAT] = "KEY_MEDIA_REPEAT", - [KEY_10CHANNELSUP] = "KEY_10CHANNELSUP", - [KEY_10CHANNELSDOWN] = "KEY_10CHANNELSDOWN", - [KEY_IMAGES] = "KEY_IMAGES", - [KEY_DEL_EOL] = "KEY_DEL_EOL", - [KEY_DEL_EOS] = "KEY_DEL_EOS", - [KEY_INS_LINE] = "KEY_INS_LINE", - [KEY_DEL_LINE] = "KEY_DEL_LINE", - [KEY_FN] = "KEY_FN", - [KEY_FN_ESC] = "KEY_FN_ESC", - [KEY_FN_F1] = "KEY_FN_F1", - [KEY_FN_F2] = "KEY_FN_F2", - [KEY_FN_F3] = "KEY_FN_F3", - [KEY_FN_F4] = "KEY_FN_F4", - [KEY_FN_F5] = "KEY_FN_F5", - [KEY_FN_F6] = "KEY_FN_F6", - [KEY_FN_F7] = "KEY_FN_F7", - [KEY_FN_F8] = "KEY_FN_F8", - [KEY_FN_F9] = "KEY_FN_F9", - [KEY_FN_F10] = "KEY_FN_F10", - [KEY_FN_F11] = "KEY_FN_F11", - [KEY_FN_F12] = "KEY_FN_F12", - [KEY_FN_1] = "KEY_FN_1", - [KEY_FN_2] = "KEY_FN_2", - [KEY_FN_D] = "KEY_FN_D", - [KEY_FN_E] = "KEY_FN_E", - [KEY_FN_F] = "KEY_FN_F", - [KEY_FN_S] = "KEY_FN_S", - [KEY_FN_B] = "KEY_FN_B", - [KEY_BRL_DOT1] = "KEY_BRL_DOT1", - [KEY_BRL_DOT2] = "KEY_BRL_DOT2", - [KEY_BRL_DOT3] = "KEY_BRL_DOT3", - [KEY_BRL_DOT4] = "KEY_BRL_DOT4", - [KEY_BRL_DOT5] = "KEY_BRL_DOT5", - [KEY_BRL_DOT6] = "KEY_BRL_DOT6", - [KEY_BRL_DOT7] = "KEY_BRL_DOT7", - [KEY_BRL_DOT8] = "KEY_BRL_DOT8", - [KEY_BRL_DOT9] = "KEY_BRL_DOT9", - [KEY_BRL_DOT10] = "KEY_BRL_DOT10", - [KEY_NUMERIC_0] = "KEY_NUMERIC_0", - [KEY_NUMERIC_1] = "KEY_NUMERIC_1", - [KEY_NUMERIC_2] = "KEY_NUMERIC_2", - [KEY_NUMERIC_3] = "KEY_NUMERIC_3", - [KEY_NUMERIC_4] = "KEY_NUMERIC_4", - [KEY_NUMERIC_5] = "KEY_NUMERIC_5", - [KEY_NUMERIC_6] = "KEY_NUMERIC_6", - [KEY_NUMERIC_7] = "KEY_NUMERIC_7", - [KEY_NUMERIC_8] = "KEY_NUMERIC_8", - [KEY_NUMERIC_9] = "KEY_NUMERIC_9", - [KEY_NUMERIC_STAR] = "KEY_NUMERIC_STAR", - [KEY_NUMERIC_POUND] = "KEY_NUMERIC_POUND", - [KEY_CAMERA_FOCUS] = "KEY_CAMERA_FOCUS", - [KEY_WPS_BUTTON] = "KEY_WPS_BUTTON", - [KEY_TOUCHPAD_TOGGLE] = "KEY_TOUCHPAD_TOGGLE", - [KEY_TOUCHPAD_ON] = "KEY_TOUCHPAD_ON", - [KEY_TOUCHPAD_OFF] = "KEY_TOUCHPAD_OFF", - [KEY_CAMERA_ZOOMIN] = "KEY_CAMERA_ZOOMIN", - [KEY_CAMERA_ZOOMOUT] = "KEY_CAMERA_ZOOMOUT", - [KEY_CAMERA_UP] = "KEY_CAMERA_UP", - [KEY_CAMERA_DOWN] = "KEY_CAMERA_DOWN", - [KEY_CAMERA_LEFT] = "KEY_CAMERA_LEFT", - [KEY_CAMERA_RIGHT] = "KEY_CAMERA_RIGHT", - [BTN_TRIGGER_HAPPY1] = "BTN_TRIGGER_HAPPY1", - [BTN_TRIGGER_HAPPY2] = "BTN_TRIGGER_HAPPY2", - [BTN_TRIGGER_HAPPY3] = "BTN_TRIGGER_HAPPY3", - [BTN_TRIGGER_HAPPY4] = "BTN_TRIGGER_HAPPY4", - [BTN_TRIGGER_HAPPY5] = "BTN_TRIGGER_HAPPY5", - [BTN_TRIGGER_HAPPY6] = "BTN_TRIGGER_HAPPY6", - [BTN_TRIGGER_HAPPY7] = "BTN_TRIGGER_HAPPY7", - [BTN_TRIGGER_HAPPY8] = "BTN_TRIGGER_HAPPY8", - [BTN_TRIGGER_HAPPY9] = "BTN_TRIGGER_HAPPY9", - [BTN_TRIGGER_HAPPY10] = "BTN_TRIGGER_HAPPY10", - [BTN_TRIGGER_HAPPY11] = "BTN_TRIGGER_HAPPY11", - [BTN_TRIGGER_HAPPY12] = "BTN_TRIGGER_HAPPY12", - [BTN_TRIGGER_HAPPY13] = "BTN_TRIGGER_HAPPY13", - [BTN_TRIGGER_HAPPY14] = "BTN_TRIGGER_HAPPY14", - [BTN_TRIGGER_HAPPY15] = "BTN_TRIGGER_HAPPY15", - [BTN_TRIGGER_HAPPY16] = "BTN_TRIGGER_HAPPY16", - [BTN_TRIGGER_HAPPY17] = "BTN_TRIGGER_HAPPY17", - [BTN_TRIGGER_HAPPY18] = "BTN_TRIGGER_HAPPY18", - [BTN_TRIGGER_HAPPY19] = "BTN_TRIGGER_HAPPY19", - [BTN_TRIGGER_HAPPY20] = "BTN_TRIGGER_HAPPY20", - [BTN_TRIGGER_HAPPY21] = "BTN_TRIGGER_HAPPY21", - [BTN_TRIGGER_HAPPY22] = "BTN_TRIGGER_HAPPY22", - [BTN_TRIGGER_HAPPY23] = "BTN_TRIGGER_HAPPY23", - [BTN_TRIGGER_HAPPY24] = "BTN_TRIGGER_HAPPY24", - [BTN_TRIGGER_HAPPY25] = "BTN_TRIGGER_HAPPY25", - [BTN_TRIGGER_HAPPY26] = "BTN_TRIGGER_HAPPY26", - [BTN_TRIGGER_HAPPY27] = "BTN_TRIGGER_HAPPY27", - [BTN_TRIGGER_HAPPY28] = "BTN_TRIGGER_HAPPY28", - [BTN_TRIGGER_HAPPY29] = "BTN_TRIGGER_HAPPY29", - [BTN_TRIGGER_HAPPY30] = "BTN_TRIGGER_HAPPY30", - [BTN_TRIGGER_HAPPY31] = "BTN_TRIGGER_HAPPY31", - [BTN_TRIGGER_HAPPY32] = "BTN_TRIGGER_HAPPY32", - [BTN_TRIGGER_HAPPY33] = "BTN_TRIGGER_HAPPY33", - [BTN_TRIGGER_HAPPY34] = "BTN_TRIGGER_HAPPY34", - [BTN_TRIGGER_HAPPY35] = "BTN_TRIGGER_HAPPY35", - [BTN_TRIGGER_HAPPY36] = "BTN_TRIGGER_HAPPY36", - [BTN_TRIGGER_HAPPY37] = "BTN_TRIGGER_HAPPY37", - [BTN_TRIGGER_HAPPY38] = "BTN_TRIGGER_HAPPY38", - [BTN_TRIGGER_HAPPY39] = "BTN_TRIGGER_HAPPY39", - [BTN_TRIGGER_HAPPY40] = "BTN_TRIGGER_HAPPY40", - [KEY_MAX] = "KEY_MAX", -}; - -static const char * const led_map[LED_MAX + 1] = { - [0 ... LED_MAX] = NULL, - [LED_NUML] = "LED_NUML", - [LED_CAPSL] = "LED_CAPSL", - [LED_SCROLLL] = "LED_SCROLLL", - [LED_COMPOSE] = "LED_COMPOSE", - [LED_KANA] = "LED_KANA", - [LED_SLEEP] = "LED_SLEEP", - [LED_SUSPEND] = "LED_SUSPEND", - [LED_MUTE] = "LED_MUTE", - [LED_MISC] = "LED_MISC", - [LED_MAIL] = "LED_MAIL", - [LED_CHARGING] = "LED_CHARGING", - [LED_MAX] = "LED_MAX", -}; - -static const char * const snd_map[SND_MAX + 1] = { - [0 ... SND_MAX] = NULL, - [SND_CLICK] = "SND_CLICK", - [SND_BELL] = "SND_BELL", - [SND_TONE] = "SND_TONE", - [SND_MAX] = "SND_MAX", -}; - -static const char * const msc_map[MSC_MAX + 1] = { - [0 ... MSC_MAX] = NULL, - [MSC_SERIAL] = "MSC_SERIAL", - [MSC_PULSELED] = "MSC_PULSELED", - [MSC_GESTURE] = "MSC_GESTURE", - [MSC_RAW] = "MSC_RAW", - [MSC_SCAN] = "MSC_SCAN", - [MSC_TIMESTAMP] = "MSC_TIMESTAMP", - [MSC_MAX] = "MSC_MAX", -}; - -static const char * const sw_map[SW_MAX + 1] = { - [0 ... SW_MAX] = NULL, - [SW_LID] = "SW_LID", - [SW_TABLET_MODE] = "SW_TABLET_MODE", - [SW_HEADPHONE_INSERT] = "SW_HEADPHONE_INSERT", - [SW_RFKILL_ALL] = "SW_RFKILL_ALL", - [SW_MICROPHONE_INSERT] = "SW_MICROPHONE_INSERT", - [SW_DOCK] = "SW_DOCK", - [SW_LINEOUT_INSERT] = "SW_LINEOUT_INSERT", - [SW_JACK_PHYSICAL_INSERT] = "SW_JACK_PHYSICAL_INSERT", - [SW_VIDEOOUT_INSERT] = "SW_VIDEOOUT_INSERT", - [SW_CAMERA_LENS_COVER] = "SW_CAMERA_LENS_COVER", - [SW_KEYPAD_SLIDE] = "SW_KEYPAD_SLIDE", - [SW_FRONT_PROXIMITY] = "SW_FRONT_PROXIMITY", - [SW_ROTATE_LOCK] = "SW_ROTATE_LOCK", - [SW_LINEIN_INSERT] = "SW_LINEIN_INSERT", - [SW_MAX] = "SW_MAX", -}; - -static const char * const ff_map[FF_MAX + 1] = { - [0 ... FF_MAX] = NULL, - [FF_STATUS_STOPPED] = "FF_STATUS_STOPPED", - [FF_STATUS_MAX] = "FF_STATUS_MAX", - [FF_AUTOCENTER] = "FF_AUTOCENTER", - [FF_GAIN] = "FF_GAIN", - [FF_RUMBLE] = "FF_RUMBLE", - [FF_PERIODIC] = "FF_PERIODIC", - [FF_CONSTANT] = "FF_CONSTANT", - [FF_SPRING] = "FF_SPRING", - [FF_FRICTION] = "FF_FRICTION", - [FF_DAMPER] = "FF_DAMPER", - [FF_INERTIA] = "FF_INERTIA", - [FF_RAMP] = "FF_RAMP", - [FF_SQUARE] = "FF_SQUARE", - [FF_TRIANGLE] = "FF_TRIANGLE", - [FF_SINE] = "FF_SINE", - [FF_SAW_UP] = "FF_SAW_UP", - [FF_SAW_DOWN] = "FF_SAW_DOWN", - [FF_CUSTOM] = "FF_CUSTOM", - [FF_MAX] = "FF_MAX", -}; - -static const char * const syn_map[SYN_MAX + 1] = { - [0 ... SYN_MAX] = NULL, - [SYN_REPORT] = "SYN_REPORT", - [SYN_CONFIG] = "SYN_CONFIG", - [SYN_MT_REPORT] = "SYN_MT_REPORT", - [SYN_DROPPED] = "SYN_DROPPED", -}; - -static const char * const input_prop_map[INPUT_PROP_MAX + 1] = { - [0 ... INPUT_PROP_MAX] = NULL, - [INPUT_PROP_POINTER] = "INPUT_PROP_POINTER", - [INPUT_PROP_DIRECT] = "INPUT_PROP_DIRECT", - [INPUT_PROP_BUTTONPAD] = "INPUT_PROP_BUTTONPAD", - [INPUT_PROP_SEMI_MT] = "INPUT_PROP_SEMI_MT", - [INPUT_PROP_MAX] = "INPUT_PROP_MAX", -}; - -static const char * const * const map[EV_MAX + 1] = { - [0 ... EV_MAX] = NULL, - [EV_REL] = rel_map, - [EV_ABS] = abs_map, - [EV_KEY] = key_map, - [EV_LED] = led_map, - [EV_SND] = snd_map, - [EV_MSC] = msc_map, - [EV_SW] = sw_map, - [EV_FF] = ff_map, - [EV_SYN] = syn_map, -}; - -static const char * event_get_type_name(int type) { - return ev_map[type]; - } - -static const char * event_get_code_name(int type, int code) { - return map[type] ? map[type][code] : NULL; -} - -#endif /* EVENT_NAMES_H */ diff --git a/tools/libevdev-events.c b/tools/libevdev-events.c index a781de9..a453477 100644 --- a/tools/libevdev-events.c +++ b/tools/libevdev-events.c @@ -32,7 +32,6 @@ #include #include "libevdev.h" -#include "event-names.h" static void print_abs_bits(struct libevdev *dev, int axis) @@ -63,7 +62,7 @@ print_code_bits(struct libevdev *dev, unsigned int type, unsigned int max) if (!libevdev_has_event_code(dev, type, i)) continue; - printf(" Event code %i (%s)\n", i, event_get_code_name(type, i)); + printf(" Event code %i (%s)\n", i, libevdev_get_event_code_name(type, i)); if (type == EV_ABS) print_abs_bits(dev, i); } @@ -77,7 +76,7 @@ print_bits(struct libevdev *dev) for (i = 0; i <= EV_MAX; i++) { if (libevdev_has_event_type(dev, i)) - printf(" Event type %d (%s)\n", i, event_get_type_name(i)); + printf(" Event type %d (%s)\n", i, libevdev_get_event_type_name(i)); switch(i) { case EV_KEY: print_code_bits(dev, EV_KEY, KEY_MAX); @@ -103,7 +102,8 @@ print_props(struct libevdev *dev) for (i = 0; i <= INPUT_PROP_MAX; i++) { if (libevdev_has_property(dev, i)) - printf(" Property type %d (%s)\n", i, input_prop_map[i]); + printf(" Property type %d (%s)\n", i, + libevdev_get_input_prop_name(i)); } } @@ -113,15 +113,15 @@ int print_event(struct input_event *ev) printf("Event: time %ld.%06ld, ++++++++++++++++++++ %s +++++++++++++++\n", ev->time.tv_sec, ev->time.tv_usec, - event_get_type_name(ev->type)); + libevdev_get_event_type_name(ev->type)); else printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %d\n", ev->time.tv_sec, ev->time.tv_usec, ev->type, - event_get_type_name(ev->type), + libevdev_get_event_type_name(ev->type), ev->code, - event_get_code_name(ev->type, ev->code), + libevdev_get_event_code_name(ev->type, ev->code), ev->value); return 0; } -- 2.7.4