[PATCH libinput 1/6] tools: print config options for each device on DEVICE_ADDED

Peter Hutterer peter.hutterer at who-t.net
Tue Nov 18 23:26:42 PST 2014


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 tools/event-debug.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tools/event-debug.c b/tools/event-debug.c
index fb22f3b..00882bf 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -257,6 +257,7 @@ print_device_notify(struct libinput_event *ev)
 	struct libinput_device *dev = libinput_event_get_device(ev);
 	struct libinput_seat *seat = libinput_device_get_seat(dev);
 	double w, h;
+	uint32_t scroll_modes;
 
 	printf("%s	%s",
 	       libinput_seat_get_physical_name(seat),
@@ -265,7 +266,28 @@ print_device_notify(struct libinput_event *ev)
 	if (libinput_device_get_size(dev, &w, &h) == 0)
 		printf("\tsize %.2f/%.2fmm", w, h);
 
+	if (libinput_device_config_tap_get_finger_count((dev)))
+	    printf(" tap");
+	if (libinput_device_config_buttons_has_left_handed((dev)))
+	    printf(" left");
+	if (libinput_device_config_scroll_has_natural_scroll((dev)))
+	    printf(" scroll-nat");
+	if (libinput_device_config_calibration_has_matrix((dev)))
+	    printf(" calib");
+
+	scroll_modes = libinput_device_config_scroll_get_modes(dev);
+	if (scroll_modes != LIBINPUT_CONFIG_SCROLL_NO_SCROLL) {
+		printf(" scroll");
+		if (scroll_modes & LIBINPUT_CONFIG_SCROLL_2FG)
+			printf("-2fg");
+		if (scroll_modes & LIBINPUT_CONFIG_SCROLL_EDGE)
+			printf("-edge");
+		if (scroll_modes & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN)
+			printf("-button");
+	}
+
 	printf("\n");
+
 }
 
 static void
-- 
2.1.0



More information about the wayland-devel mailing list