diff options
author | Olivier Samyn <code@oleastre.be> | 2010-02-21 00:17:57 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-02-22 16:24:21 +1000 |
commit | 823d606ca716253ac55ed46ee1559fd17adc0988 (patch) | |
tree | 74eb12f9b5498d21839760b237d6eedf128a9694 | |
parent | 8b2eb587cc2ec96e54c28def4fa9388d7bd49c91 (diff) |
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 <code@oleastre.be>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | 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 */ |