tools: add mode group info to libinput-list-devices
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 24 Feb 2017 00:15:23 +0000 (10:15 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Sun, 26 Feb 2017 23:36:37 +0000 (09:36 +1000)
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@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
tools/libinput-list-devices.c

index 3d86392621c400f0d277e1c07da7dfa73a9ce008..aad605a4b36f1c69894773b87d76b06e33883b39 100644 (file)
@@ -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