evdev: INPUT_PROP_DIRECT devices can't be touchpads
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 29 May 2014 05:43:38 +0000 (15:43 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 29 May 2014 21:11:59 +0000 (07:11 +1000)
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>
src/evdev.c

index d23e349..cc54ab3 100644 (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);