evdev: INPUT_PROP_DIRECT devices can't be touchpads

Devices that are direct input devices are marked by the kernel with the
INPUT_PROP_DIRECT property. Touchpads are always indirect input devices, so
let's do the easiest check first before we try device-specific capabilities.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2014-05-29 15:43:38 +10:00
parent eae6bec344
commit 90b8de4ddd

View file

@ -672,7 +672,8 @@ evdev_configure_device(struct evdev_device *device)
has_rel = 1;
if (libevdev_has_event_type(evdev, EV_KEY)) {
if (libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_FINGER) &&
if (!libevdev_has_property(evdev, INPUT_PROP_DIRECT) &&
libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_FINGER) &&
!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_PEN) &&
(has_abs || has_mt)) {
device->dispatch = evdev_mt_touchpad_create(device);