evdev: Clear touch capability if we see a mouse-type button

If an input device has BTN_LEFT (typically) it's not a touch screen but
a touch pad.
dev
Kristian Høgsberg 11 years ago
parent 9df41e153c
commit c133fc4836
  1. 8
      src/evdev.c

@ -524,16 +524,16 @@ evdev_handle_device(struct evdev_device *device)
break; break;
} }
} }
if (TEST_BIT(key_bits, BTN_TOUCH)) {
device->caps |= EVDEV_TOUCH;
}
for (i = BTN_MISC; i < BTN_JOYSTICK; i++) { for (i = BTN_MISC; i < BTN_JOYSTICK; i++) {
if (TEST_BIT(key_bits, i)) { if (TEST_BIT(key_bits, i)) {
device->caps |= EVDEV_BUTTON; device->caps |= EVDEV_BUTTON;
device->caps &= ~EVDEV_TOUCH;
break; break;
} }
} }
if (TEST_BIT(key_bits, BTN_TOUCH)) {
device->caps |= EVDEV_TOUCH;
}
} }
if (TEST_BIT(ev_bits, EV_LED)) { if (TEST_BIT(ev_bits, EV_LED)) {
device->caps |= EVDEV_KEYBOARD; device->caps |= EVDEV_KEYBOARD;

Loading…
Cancel
Save