diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-21 13:30:10 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-30 09:44:33 +1000 |
commit | 4efe0d272ed6ef7bda4cc005ad6033f2b1916fdc (patch) | |
tree | 29029bb3d8b9bd3239c750f729029c9a5f61dd02 | |
parent | 1432b5153ec2666845c2017eedc3c166fd8c8e3c (diff) |
Deal with BTN_3 to BTN_9 buttons.
These buttons were previously mapped to 0, i.e. inactive. This patch
slightly improves things in that the buttons are now mapped to 8+.
Devices that have both BTN_3 and BTN_SIDE (or a similar pair in that
sequence) have both mapped to the same button number though.
Devices that have BTN_LEFT, BTN_0, BTN_3 and BTN_SIDE have the last three
mapped to 8 (and their followers have double-mappings too). We'll fix that
once we actually see devices affected by this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit dc2191285e799be891787e1f64d10c1cba271240)
-rw-r--r-- | src/evdev.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c index b880c6a..3a9fb0e 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1767,6 +1767,17 @@ EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code) button = (TestBit(BTN_RIGHT, pEvdev->key_bitmask)) ? 10 : 3; break; + /* FIXME: BTN_3.. and BTN_SIDE.. have the same button mapping */ + case BTN_3: + case BTN_4: + case BTN_5: + case BTN_6: + case BTN_7: + case BTN_8: + case BTN_9: + button = (code - BTN_0 + 5); + break; + case BTN_SIDE: case BTN_EXTRA: case BTN_FORWARD: |