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.
This commit is contained in:
Kristian Høgsberg 2013-10-14 15:46:13 -07:00 committed by Jonas Ådahl
parent 3fc0ec1bc3
commit d4c9c6b83b

View file

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