[PATCH libinput 2/2] tools: add mode group info to libinput-list-devices

Peter Hutterer peter.hutterer at who-t.net
Fri Feb 24 04:41:26 UTC 2017


We don't cater for the special case of groups having a different number of
modes, there is no hardware right now that does that.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 tools/libinput-list-devices.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/libinput-list-devices.c b/tools/libinput-list-devices.c
index 3d86392..aad605a 100644
--- a/tools/libinput-list-devices.c
+++ b/tools/libinput-list-devices.c
@@ -245,16 +245,23 @@ rotation_default(struct libinput_device *device)
 static void
 print_pad_info(struct libinput_device *device)
 {
-	int nbuttons, nrings, nstrips;
+	int nbuttons, nrings, nstrips, ngroups, nmodes;
+	struct libinput_tablet_pad_mode_group *group;
 
 	nbuttons = libinput_device_tablet_pad_get_num_buttons(device);
 	nrings = libinput_device_tablet_pad_get_num_rings(device);
 	nstrips = libinput_device_tablet_pad_get_num_strips(device);
+	ngroups = libinput_device_tablet_pad_get_num_mode_groups(device);
+
+	group = libinput_device_tablet_pad_get_mode_group(device, 0);
+	nmodes = libinput_tablet_pad_mode_group_get_num_modes(group);
 
 	printf("Pad:\n");
 	printf("	Rings:   %d\n", nrings);
 	printf("	Strips:  %d\n", nstrips);
 	printf("	Buttons: %d\n", nbuttons);
+	printf("	Mode groups: %d (%d modes)\n", ngroups, nmodes);
+
 }
 
 static void
-- 
2.9.3



More information about the wayland-devel mailing list