From 3e6786b1e475b84648e4dd43996371ebf297d7b8 Mon Sep 17 00:00:00 2001 From: Olivier Samyn Date: Sun, 21 Feb 2010 00:17:57 +0100 Subject: [PATCH] aiptek: Correct linux keymap to keysym index loop. Makes the loop iterate over all elements of the linux key map, and if the current macroKey matches, generate a key event. Signed-off-by: Olivier Samyn --- src/xf86Aiptek.c | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c index 4ec9c4a..e70d58f 100644 --- a/src/xf86Aiptek.c +++ b/src/xf86Aiptek.c @@ -452,26 +452,26 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z) sizeof(linux_inputDevice_keyMap[0]); ++i) { - if (linux_inputDevice_keyMap[0]==common->currentValues.macroKey) + if (linux_inputDevice_keyMap[i]==common->currentValues.macroKey) { + /* First available Keycode begins at 8 => macro+8. + * It's pervasive throughout the Xinput drivers, and + * no, I don't know why they purposively waste the first 8 + * positions of the KeySym map... + */ + + /* Keyboard 'make' (press) event */ + xf86PostKeyEvent(local->dev, i+7, TRUE, + bAbsolute, 0, 5, + x, y, common->currentValues.button, xTilt, yTilt); + /* Keyboard 'break' (depress) event */ + xf86PostKeyEvent(local->dev, i+7, FALSE, + bAbsolute, 0, 5, + x, y, common->currentValues.button, xTilt, yTilt); break; } } - /* First available Keycode begins at 8 => macro+7. - * It's pervasive throughout the Xinput drivers, and - * no, I don't know why they purposively waste the first 8 - * positions of the KeySym map... - */ - - /* Keyboard 'make' (press) event */ - xf86PostKeyEvent(local->dev, i+7, TRUE, - bAbsolute, 0, 5, - x, y, common->currentValues.button, xTilt, yTilt); - /* Keyboard 'break' (depress) event */ - xf86PostKeyEvent(local->dev, i+7, FALSE, - bAbsolute, 0, 5, - x, y, common->currentValues.button, xTilt, yTilt); } /* As the coordinates are ready, we can send events to X */ -- 1.6.3.3