summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2010-10-20 23:31:30 +0400
committerPeter Hutterer <peter.hutterer@who-t.net>2010-10-22 07:52:48 +1000
commit5e26ba8641809addc63e783e1cefac0f8524b020 (patch)
tree3c4d88ff1e6916a852d5585c467b4f0bb199324e
parent71dd18f72889ef6998a1bd699630da583dcb775a (diff)
Extend button mapping to full ranges
Extend button code to number mapping to cover full BTN_MOUSE and BTN_MISC ranges, including undefined codes. This extends mapping introduced with 0367e387 to the following: 1 BTN_LEFT BTN_0 BTN_TOUCH 2 BTN_MIDDLE BTN_1 BTN_STYLUS 3 BTN_RIGHT BTN_2 BTN_STYLUS2 8 BTN_SIDE BTN_3 9 BTN_EXTRA BTN_4 10 BTN_FORWARD BTN_5 11 BTN_BACK BTN_6 12 BTN_TASK BTN_7 13 0x118 BTN_8 14 0x119 BTN_9 15 0x11A 0x10A 16 0x11B 0x10B 17 0x11C 0x10C 18 0x11D 0x10D 19 0x11E 0x10E 20 0x11F 0x10F This should fix https://bugs.freedesktop.org/show_bug.cgi?id=30336 Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 3c5fa89..32253a2 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2345,13 +2345,13 @@ EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code)
return 2;
case BTN_RIGHT:
return 3;
- case BTN_SIDE ... BTN_TASK:
+ case BTN_SIDE ... BTN_JOYSTICK - 1:
return 8 + code - BTN_SIDE;
/* Generic buttons */
case BTN_0 ... BTN_2:
return 1 + code - BTN_0;
- case BTN_3 ... BTN_9:
+ case BTN_3 ... BTN_MOUSE - 1:
return 8 + code - BTN_3;
/* Tablet stylus buttons */