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>
master
Peter Hutterer 17 years ago
parent 255b9f6bbf
commit dc2191285e
  1. 11
      src/evdev.c

@ -1805,6 +1805,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:

Loading…
Cancel
Save