[PATCH libinput 01/23] Add LIBINPUT_DEVICE_CAP_TABLET libinput_device_capability value

Stephen Chandler Paul thatslyude at gmail.com
Thu Jun 12 20:28:22 PDT 2014


From: Carlos Garnacho <carlosg at gnome.org>

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>
Signed-off-by: Stephen Chandler Paul <thatslyude at gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 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 51ad5e3..03f52e4 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -840,6 +840,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_TABLET:
+		return !!(device->seat_caps & EVDEV_DEVICE_TABLET);
 	default:
 		return 0;
 	}
diff --git a/src/evdev.h b/src/evdev.h
index d057010..bcb7e79 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -45,7 +45,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 mt_slot {
diff --git a/src/libinput.h b/src/libinput.h
index 54c96e5..d6f2588 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -121,7 +121,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_TABLET = 3
 };
 
 /**
-- 
1.8.5.5



More information about the wayland-devel mailing list