This capability flag would be enabled when events are driven through
a stylus, ie. on a tablet.

Signed-off-by: Carlos Garnacho <carl...@gnome.org>
---
 src/evdev.c    | 2 ++
 src/evdev.h    | 3 ++-
 src/libinput.h | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 94fe67b..71da8f7 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -773,6 +773,8 @@ evdev_device_has_capability(struct evdev_device *device,
                return !!(device->seat_caps & EVDEV_DEVICE_KEYBOARD);
        case LIBINPUT_DEVICE_CAP_TOUCH:
                return !!(device->seat_caps & EVDEV_DEVICE_TOUCH);
+       case LIBINPUT_DEVICE_CAP_STYLUS:
+               return !!(device->seat_caps & EVDEV_DEVICE_TABLET);
        default:
                return 0;
        }
diff --git a/src/evdev.h b/src/evdev.h
index 0ab9572..a798ab6 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -47,7 +47,8 @@ enum evdev_event_type {
 enum evdev_device_seat_capability {
        EVDEV_DEVICE_POINTER = (1 << 0),
        EVDEV_DEVICE_KEYBOARD = (1 << 1),
-       EVDEV_DEVICE_TOUCH = (1 << 2)
+       EVDEV_DEVICE_TOUCH = (1 << 2),
+       EVDEV_DEVICE_TABLET = (1 << 3),
 };
 
 struct evdev_device {
diff --git a/src/libinput.h b/src/libinput.h
index 05690a9..f6a881c 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -64,7 +64,8 @@ enum libinput_log_priority {
 enum libinput_device_capability {
        LIBINPUT_DEVICE_CAP_KEYBOARD = 0,
        LIBINPUT_DEVICE_CAP_POINTER = 1,
-       LIBINPUT_DEVICE_CAP_TOUCH = 2
+       LIBINPUT_DEVICE_CAP_TOUCH = 2,
+       LIBINPUT_DEVICE_CAP_STYLUS = 3
 };
 
 /**
-- 
1.9.0

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to