Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: phooky/IBM-5291
base: 3b1923008a
...
head fork: phooky/IBM-5291
compare: 5eb64036a7
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 113 additions and 284 deletions.
  1. +7 −0 README.md
  2. +106 −284 eventmap.c
View
7 README.md
@@ -9,3 +9,10 @@ All pins are on GPIO2.
P8.7 2_2 Horizontal
P8.9 2_5 Video
+Packages
+========
+
+Needs ubuntu/debian for the BBB. Required packages:
+
+sudo apt-get install xvfb libxtst-dev xterm
+sudo apt-get install libxcb-xtest0-dev make libc6-dev g++ gcc libext-dev
View
390 eventmap.c
@@ -24,291 +24,113 @@ static Display * dpy;
// table from http://lists.freedesktop.org/pipermail/xorg/2006-May/015587.html
// arrow keys are borked; need to revisit this.
-static const int keymap[] = {
- 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
-22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
-38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
-54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
-70, 71,
- 72, 73, 74, 75, 76, 77, 76, 79, 80, 81, 82, 83, 84, 85,
-86, 87,
- 88, 89, 90, 91, 111, 221, 94, 95, 96, 211, 128, 127, 129, 208,
-131, 126,
- 108, 109, 112, 111, 113, 181, 97, 98, 99, 100, 102, 103, 104, 105,
-106, 107,
- 239, 160, 174, 176, 222, 157, 123, 110, 139, 134, 209, 210, 133, 115,
-116, 117,
- 232, 133, 134, 135, 140, 248, 191, 192, 122, 188, 245, 158, 161, 193,
-223, 227,
- 198, 199, 200, 147, 159, 151, 178, 201, 146, 203, 166, 236, 230, 235,
-234, 233,
- 163, 204, 253, 153, 162, 144, 164, 177, 152, 190, 208, 129, 130, 231,
-209, 210,
- 136, 220, 143, 246, 251, 137, 138, 182, 183, 184, 93, 184, 247, 132,
-170, 219,
- 249, 205, 207, 149, 150, 154, 155, 167, 168, 169, 171, 172, 173, 165,
-175, 179,
- 180, 0, 185, 186, 187, 118, 119, 120, 121, 229, 194, 195, 196, 197,
-148, 202,
- 101, 212, 237, 214, 215, 216, 217, 218, 228, 142, 213, 240, 241, 242,
-243, 244,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0
-#if 0
+static const int keymap[255] = {
// this doesn't work. bummer;
- [KEY_RESERVED] = 0,
- [KEY_ESC] = XK_Escape,
- [KEY_1] = XK_1,
- [KEY_2] = XK_2,
- [KEY_3] = XK_3,
- [KEY_4] = XK_4,
- [KEY_5] = XK_5,
- [KEY_6] = XK_6,
- [KEY_7] = XK_7,
- [KEY_8] = XK_8,
- [KEY_9] = XK_9,
- [KEY_0] = XK_0,
- [KEY_MINUS] = XK_minus,
- [KEY_EQUAL] = XK_equal,
- [KEY_BACKSPACE] = XK_BackSpace,
- [KEY_TAB] = XK_Tab,
- [KEY_Q] = XK_Q,
- [KEY_W] = XK_W,
- [KEY_E] = XK_E,
- [KEY_R] = XK_R,
- [KEY_T] = XK_T,
- [KEY_Y] = XK_Y,
- [KEY_U] = XK_U,
- [KEY_I] = XK_I,
- [KEY_O] = XK_O,
- [KEY_P] = XK_P,
- [KEY_LEFTBRACE] = XK_braceleft,
- [KEY_RIGHTBRACE] = XK_braceright,
- [KEY_ENTER] = XK_Return,
- [KEY_LEFTCTRL] = XK_Control_L,
- [KEY_A] = XK_A,
- [KEY_S] = XK_S,
- [KEY_D] = XK_D,
- [KEY_F] = XK_F,
- [KEY_G] = XK_G,
- [KEY_H] = XK_H,
- [KEY_J] = XK_J,
- [KEY_K] = XK_K,
- [KEY_L] = XK_L,
- [KEY_SEMICOLON] = XK_semicolon,
- [KEY_APOSTROPHE] = XK_apostrophe,
- [KEY_GRAVE] = XK_grave,
- [KEY_LEFTSHIFT] = XK_Shift_L,
- [KEY_BACKSLASH] = XK_backslash,
- [KEY_Z] = XK_Z,
- [KEY_X] = XK_X,
- [KEY_C] = XK_C,
- [KEY_V] = XK_V,
- [KEY_B] = XK_B,
- [KEY_N] = XK_N,
- [KEY_M] = XK_M,
- [KEY_COMMA] = XK_comma,
- [KEY_DOT] = XK_period,
- [KEY_SLASH] = XK_slash,
- [KEY_RIGHTSHIFT] = XK_Shift_R,
- [KEY_KPASTERISK] = XK_KP_Multiply,
- [KEY_LEFTALT] = XK_Alt_L,
- [KEY_SPACE] = XK_space,
- [KEY_CAPSLOCK] = XK_Caps_Lock,
- [KEY_F1] = XK_F1,
- [KEY_F2] = XK_F2,
- [KEY_F3] = XK_F3,
- [KEY_F4] = XK_F4,
- [KEY_F5] = XK_F5,
- [KEY_F6] = XK_F6,
- [KEY_F7] = XK_F7,
- [KEY_F8] = XK_F8,
- [KEY_F9] = XK_F9,
- [KEY_F10] = XK_F10,
- [KEY_NUMLOCK] = XK_Num_Lock,
- [KEY_SCROLLLOCK] = XK_Scroll_Lock,
- [KEY_KP7] = XK_KP_7,
- [KEY_KP8] = XK_KP_8,
- [KEY_KP9] = XK_KP_9,
- [KEY_KPMINUS] = XK_KP_Subtract,
- [KEY_KP4] = XK_KP_4,
- [KEY_KP5] = XK_KP_5,
- [KEY_KP6] = XK_KP_6,
- [KEY_KPPLUS] = XK_KP_Add,
- [KEY_KP1] = XK_KP_1,
- [KEY_KP2] = XK_KP_2,
- [KEY_KP3] = XK_KP_3,
- [KEY_KP0] = XK_KP_0,
- [KEY_KPDOT] = XK_KP_Decimal,
- [KEY_ZENKAKUHANKAKU] = XK_Zenkaku_Hankaku,
- //[KEY_102ND] = XK_102ND,
- [KEY_F11] = XK_F11,
- [KEY_F12] = XK_F12,
-#if 0
- [KEY_RO] = XK_RO,
- [KEY_KATAKANA] = XK_KATAKANA,
- [KEY_HIRAGANA] = XK_HIRAGANA,
- [KEY_HENKAN] = XK_HENKAN,
- [KEY_KATAKANAHIRAGANA] = XK_KATAKANAHIRAGANA,
- [KEY_MUHENKAN] = XK_MUHENKAN,
- [KEY_KPJPCOMMA] = XK_KPJPCOMMA,
-#endif
- [KEY_KPENTER] = XK_KP_Enter,
- [KEY_RIGHTCTRL] = XK_Control_R,
- [KEY_KPSLASH] = XK_KP_Divide,
- [KEY_SYSRQ] = XK_Sys_Req,
- [KEY_RIGHTALT] = XK_Alt_R,
- [KEY_LINEFEED] = XK_Linefeed,
- [KEY_HOME] = XK_Home,
- [KEY_UP] = XK_Up,
- [KEY_PAGEUP] = XK_Page_Up,
- [KEY_LEFT] = XK_Left,
- [KEY_RIGHT] = XK_Right,
- [KEY_END] = XK_End,
- [KEY_DOWN] = XK_Down,
- [KEY_PAGEDOWN] = XK_Page_Down,
- [KEY_INSERT] = XK_Insert,
- [KEY_DELETE] = XK_Delete,
- //[KEY_MACRO] = XK_MACRO,
- //[KEY_MUTE] = XK_MUTE,
- //[KEY_VOLUMEDOWN] = XK_VOLUMEDOWN,
- //[KEY_VOLUMEUP] = XK_VOLUMEUP,
- //[KEY_POWER] = XK_POWER,
- [KEY_KPEQUAL] = XK_KP_Equal,
- //[KEY_KPPLUSMINUS] = XK_KPPLUSMINUS,
- //[KEY_PAUSE] = XK_PAUSE,
- //[KEY_SCALE] = XK_SCALE,
- //[KEY_KPCOMMA] = XK_KPCOMMA,
- //[KEY_HANGEUL] = XK_HANGEUL,
- //[KEY_HANGUEL] = XK_HANGUEL,
- //[KEY_HANJA] = XK_HANJA,
- //[KEY_YEN] = XK_YEN,
- [KEY_LEFTMETA] = XK_Meta_L,
- [KEY_RIGHTMETA] = XK_Meta_R,
-#if 0
- [KEY_COMPOSE] = XK_Compose,
- [KEY_STOP] = XK_Stop,
- [KEY_AGAIN] = XK_AGAIN,
- [KEY_PROPS] = XK_PROPS,
- [KEY_UNDO] = XK_UNDO,
- [KEY_FRONT] = XK_FRONT,
- [KEY_COPY] = XK_COPY,
- [KEY_OPEN] = XK_OPEN,
- [KEY_PASTE] = XK_PASTE,
- [KEY_FIND] = XK_FIND,
- [KEY_CUT] = XK_CUT,
- [KEY_HELP] = XK_HELP,
- [KEY_MENU] = XK_MENU,
- [KEY_CALC] = XK_CALC,
- [KEY_SETUP] = XK_SETUP,
- [KEY_SLEEP] = XK_SLEEP,
- [KEY_WAKEUP] = XK_WAKEUP,
- [KEY_FILE] = XK_FILE,
- [KEY_SENDFILE] = XK_SENDFILE,
- [KEY_DELETEFILE] = XK_DELETEFILE,
- [KEY_XFER] = XK_XFER,
- [KEY_PROG1] = XK_PROG1,
- [KEY_PROG2] = XK_PROG2,
- [KEY_WWW] = XK_WWW,
- [KEY_MSDOS] = XK_MSDOS,
- [KEY_COFFEE] = XK_COFFEE,
- [KEY_SCREENLOCK] = XK_SCREENLOCK,
- [KEY_DIRECTION] = XK_DIRECTION,
- [KEY_CYCLEWINDOWS] = XK_CYCLEWINDOWS,
- [KEY_MAIL] = XK_MAIL,
- [KEY_BOOKMARKS] = XK_BOOKMARKS,
- [KEY_COMPUTER] = XK_COMPUTER,
- [KEY_BACK] = XK_BACK,
- [KEY_FORWARD] = XK_FORWARD,
- [KEY_CLOSECD] = XK_CLOSECD,
- [KEY_EJECTCD] = XK_EJECTCD,
- [KEY_EJECTCLOSECD] = XK_EJECTCLOSECD,
- [KEY_NEXTSONG] = XK_NEXTSONG,
- [KEY_PLAYPAUSE] = XK_PLAYPAUSE,
- [KEY_PREVIOUSSONG] = XK_PREVIOUSSONG,
- [KEY_STOPCD] = XK_STOPCD,
- [KEY_RECORD] = XK_RECORD,
- [KEY_REWIND] = XK_REWIND,
- [KEY_PHONE] = XK_PHONE,
- [KEY_ISO] = XK_ISO,
- [KEY_CONFIG] = XK_CONFIG,
- [KEY_HOMEPAGE] = XK_HOMEPAGE,
- [KEY_REFRESH] = XK_REFRESH,
- [KEY_EXIT] = XK_EXIT,
- [KEY_MOVE] = XK_MOVE,
- [KEY_EDIT] = XK_EDIT,
- [KEY_SCROLLUP] = XK_SCROLLUP,
- [KEY_SCROLLDOWN] = XK_SCROLLDOWN,
- [KEY_KPLEFTPAREN] = XK_KPLEFTPAREN,
- [KEY_KPRIGHTPAREN] = XK_KPRIGHTPAREN,
- [KEY_NEW] = XK_NEW,
- [KEY_REDO] = XK_REDO,
- [KEY_F13] = XK_F13,
- [KEY_F14] = XK_F14,
- [KEY_F15] = XK_F15,
- [KEY_F16] = XK_F16,
- [KEY_F17] = XK_F17,
- [KEY_F18] = XK_F18,
- [KEY_F19] = XK_F19,
- [KEY_F20] = XK_F20,
- [KEY_F21] = XK_F21,
- [KEY_F22] = XK_F22,
- [KEY_F23] = XK_F23,
- [KEY_F24] = XK_F24,
- [KEY_PLAYCD] = XK_PLAYCD,
- [KEY_PAUSECD] = XK_PAUSECD,
- [KEY_PROG3] = XK_PROG3,
- [KEY_PROG4] = XK_PROG4,
- [KEY_DASHBOARD] = XK_DASHBOARD,
- [KEY_SUSPEND] = XK_SUSPEND,
- [KEY_CLOSE] = XK_CLOSE,
- [KEY_PLAY] = XK_PLAY,
- [KEY_FASTFORWARD] = XK_FASTFORWARD,
- [KEY_BASSBOOST] = XK_BASSBOOST,
- [KEY_PRINT] = XK_PRINT,
- [KEY_HP] = XK_HP,
- [KEY_CAMERA] = XK_CAMERA,
- [KEY_SOUND] = XK_SOUND,
- [KEY_QUESTION] = XK_QUESTION,
- [KEY_EMAIL] = XK_EMAIL,
- [KEY_CHAT] = XK_CHAT,
- [KEY_SEARCH] = XK_SEARCH,
- [KEY_CONNECT] = XK_CONNECT,
- [KEY_FINANCE] = XK_FINANCE,
- [KEY_SPORT] = XK_SPORT,
- [KEY_SHOP] = XK_SHOP,
- [KEY_ALTERASE] = XK_ALTERASE,
- [KEY_CANCEL] = XK_CANCEL,
- [KEY_BRIGHTNESSDOWN] = XK_BRIGHTNESSDOWN,
- [KEY_BRIGHTNESSUP] = XK_BRIGHTNESSUP,
- [KEY_MEDIA] = XK_MEDIA,
- [KEY_SWITCHVIDEOMODE] = XK_SWITCHVIDEOMODE,
- [KEY_KBDILLUMTOGGLE] = XK_KBDILLUMTOGGLE,
- [KEY_KBDILLUMDOWN] = XK_KBDILLUMDOWN,
- [KEY_KBDILLUMUP] = XK_KBDILLUMUP,
- [KEY_SEND] = XK_SEND,
- [KEY_REPLY] = XK_REPLY,
- [KEY_FORWARDMAIL] = XK_FORWARDMAIL,
- [KEY_SAVE] = XK_SAVE,
- [KEY_DOCUMENTS] = XK_DOCUMENTS,
- [KEY_BATTERY] = XK_BATTERY,
- [KEY_BLUETOOTH] = XK_BLUETOOTH,
- [KEY_WLAN] = XK_WLAN,
- [KEY_UWB] = XK_UWB,
- [KEY_UNKNOWN] = XK_UNKNOWN,
- [KEY_VIDEO_NEXT] = XK_VIDEO_NEXT,
- [KEY_VIDEO_PREV] = XK_VIDEO_PREV,
- [KEY_BRIGHTNESS_CYCLE] = XK_BRIGHTNESS_CYCLE,
- [KEY_BRIGHTNESS_ZERO] = XK_BRIGHTNESS_ZERO,
- [KEY_DISPLAY_OFF] = XK_DISPLAY_OFF,
- [KEY_WIMAX] = XK_WIMAX,
- [KEY_RFKILL] = XK_RFKILL,
- [KEY_MICMUTE] = XK_MICMUTE,
-#endif
-#endif
+ [0] = XK_Z,
+ [1] = XK_S,
+ [2] = XK_W,
+ [3] = XK_3,
+ [4] = XK_X,
+ [5] = XK_D,
+ [6] = XK_E,
+ [7] = XK_4,
+ [8] = XK_C,
+ [9] = XK_F,
+
+ [10] = XK_R,
+ [11] = XK_5,
+ [12] = XK_V,
+ [13] = XK_G,
+ [14] = XK_T,
+ [15] = XK_6,
+ [16] = XK_B,
+ [17] = XK_H,
+ [18] = XK_Y,
+ [19] = XK_7,
+
+ [20] = XK_N,
+ [21] = XK_J,
+ [22] = XK_U,
+ [23] = XK_B,
+ [24] = XK_KP_2,
+ [25] = XK_KP_5,
+ [26] = XK_KP_8,
+ [27] = XK_Num_Lock,
+ [28] = XK_M,
+ [29] = XK_K,
+
+ [30] = XK_I,
+ [31] = XK_9,
+ [32] = XK_comma,
+ [33] = XK_L,
+ [34] = XK_O,
+ [35] = XK_0,
+ [36] = XK_period,
+ [37] = XK_semicolon,
+ [38] = XK_p,
+ [39] = XK_minus,
+
+ [40] = XK_slash,
+ [41] = XK_apostrophe,
+ [42] = XK_braceleft,
+ [43] = XK_equal,
+ [44] = XK_space,
+ [45] = XK_Shift_R,
+ [46] = XK_backslash,
+ [47] = XK_braceright,
+ [48] = XK_Caps_Lock,
+ [49] = XK_XP_Multiply,
+
+ [50] = XK_Return,
+ [51] = XK_BackSpace,
+ [52] = XK_KP_0,
+ [53] = XK_KP_1,
+ [54] = XK_KP_4,
+ [55] = XK_KP_7,
+ [56] = XK_KP_Add,
+ [57] = 0,
+ [58] = XK_KP_Subtract,
+ [59] = XK_Scroll_Lock,
+
+ [60] = XK_KP_Decimal,
+ [61] = XK_KP_3,
+ [62] = XK_KP_6,
+ [63] = XK_KP_9,
+ [64] = 0,
+ [65] = XK_A,
+ [66] = XK_Q,
+ [67] = XK_2,
+ [68] = XK_Alt_L,
+ [69] = 0,
+
+ [70] = 0,
+ [71] = XK_1,
+ [72] = XK_F7,
+ [73] = XK_F5,
+ [74] = XK_F3,
+ [75] = XK_F1,
+ [76] = XK_F8,
+ [77] = XK_F6,
+ [78] = XK_F4,
+ [79] = XK_F2,
+
+ [80] = XK_F10,
+ [81] = 0,
+ [82] = 0,
+ [83] = 0,
+ [84] = XK_F9,
+ [85] = 0,
+ [86] = 0,
+ [87] = 0,
+ [88] = XK_Shift_L,
+ [89] = XK_Control_L,
+
+ [90] = XK_Tab,
+ [91] = XK_Escape,
+ [92] = 0,
+ [93] = 0,
+ [94] = 0,
+ [95] = 0,
};
void FakeKeyEvent(Display* dpy,unsigned int key, Bool is_press, unsigned long delay) {

No commit comments for this range

Something went wrong with that request. Please try again.