[PATCH libinput 08/24] Add LIBINPUT_DEVICE_CAP_STYLUS libinput_device_capability value

Carlos Garnacho carlosg at gnome.org
Mon Apr 21 10:11:17 PDT 2014


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

Signed-off-by: Carlos Garnacho <carlosg at 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



More information about the wayland-devel mailing list