From 012622aaef082d01d78364071920239bc792ab05 Mon Sep 17 00:00:00 2001 From: Olivier Samyn Date: Wed, 17 Feb 2010 21:49:00 +0100 Subject: [PATCH 2/3] aiptek: Uses direct event code to keycode mapping for XInput >=7. As of XInput ABI version 7, the keysym map is not used anymore, the mapping from kernel key code is immediate and equal to kernel code+8 (from evdev driver). Signed-off-by: Olivier Samyn --- src/xf86Aiptek.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c index 4ec9c4a..4ae5f3f 100644 --- a/src/xf86Aiptek.c +++ b/src/xf86Aiptek.c @@ -147,6 +147,7 @@ _X_EXPORT InputDriverRec AIPTEK = 0 /* ref count */ }; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 7 /* * This is the map of Linux Event Input system keystrokes sent for * the macro keys. There are discrepancies in the mappings, so for example, @@ -168,7 +169,6 @@ static int linux_inputDevice_keyMap[] = KEY_OPEN, KEY_PASTE }; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 7 /* * Function/Macro keys variables. * @@ -435,8 +435,9 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z) */ if (common->currentValues.macroKey != VALUE_NA) { - int i; + int i = common->currentValues.macroKey; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 7 /* This is a little silly, but: The Linux Event Input * system uses a slightly different keymap than does X * (it also has more keys defined). So, we have to go @@ -457,7 +458,7 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z) break; } } - +#endif /* 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 @@ -465,11 +466,11 @@ xf86AiptekSendEvents(LocalDevicePtr local, int r_z) */ /* Keyboard 'make' (press) event */ - xf86PostKeyEvent(local->dev, i+7, TRUE, + xf86PostKeyEvent(local->dev, i+8, TRUE, bAbsolute, 0, 5, x, y, common->currentValues.button, xTilt, yTilt); /* Keyboard 'break' (depress) event */ - xf86PostKeyEvent(local->dev, i+7, FALSE, + xf86PostKeyEvent(local->dev, i+8, FALSE, bAbsolute, 0, 5, x, y, common->currentValues.button, xTilt, yTilt); } -- 1.6.3.3