Add BTN_TOUCH/STYLUS/STYLUS2 support.

These three buttons are mapped into buttons 1/2/3, respectively.
Overlapping range with BTN_LEFT/MIDDLE/RIGHT, assuming that these
ranges don't generally appear in a single device simultaneously.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
master
Nikolai Kondrashov 16 years ago committed by Peter Hutterer
parent b83515485b
commit 617a09e298
  1. 10
      src/evdev.c

@ -2254,6 +2254,16 @@ EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code)
button = (code - BTN_LEFT + 5);
break;
case BTN_TOUCH:
button = 1;
break;
case BTN_STYLUS:
button = 2;
break;
case BTN_STYLUS2:
button = 3;
break;
default:
if ((code > BTN_TASK) && (code < KEY_OK)) {
if (code < BTN_JOYSTICK) {

Loading…
Cancel
Save