evdev: Let dispatch instances set their own capabilities
authorJonas Ådahl <jadahl@gmail.com>
Sat, 26 Jul 2014 19:34:47 +0000 (21:34 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Mon, 18 Aug 2014 20:35:19 +0000 (22:35 +0200)
It's up to a evdev device backend to configure seat capabilities it
supports. Even though it may be possible for a touchpad to have extra
keys, there is currently no support for sending keyboard events from the
touchpad driver, and if that would be implemented, it'd be a detail of
the touchpad driver, not the generic evdev device part.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-mt-touchpad.c
src/evdev.c

index b58a6ca..d831b83 100644 (file)
@@ -824,6 +824,8 @@ tp_init(struct tp_dispatch *tp,
        if (tp_init_palmdetect(tp, device) != 0)
                return -1;
 
+       device->seat_caps |= EVDEV_DEVICE_POINTER;
+
        return 0;
 }
 
index a125510..5a0ff90 100644 (file)
@@ -707,6 +707,7 @@ evdev_configure_device(struct evdev_device *device)
                        log_info(libinput,
                                 "input device '%s', %s is a touchpad\n",
                                 device->devname, device->devnode);
+                       return device->dispatch == NULL ? -1 : 0;
                }
                for (i = KEY_ESC; i < KEY_MAX; i++) {
                        if (i >= BTN_MISC && i < KEY_OK)