tools: print button/ring/strip info for pads

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2016-05-27 14:56:09 +10:00
parent 4f8088066c
commit b2772abb46

View file

@ -241,6 +241,21 @@ rotation_default(struct libinput_device *device)
return str;
}
static void
print_pad_info(struct libinput_device *device)
{
int nbuttons, nrings, nstrips;
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);
printf("Pad:\n");
printf(" Rings: %d\n", nrings);
printf(" Strips: %d\n", nstrips);
printf(" Buttons: %d\n", nbuttons);
}
static void
print_device_notify(struct libinput_event *ev)
{
@ -321,6 +336,10 @@ print_device_notify(struct libinput_event *ev)
printf("Rotation: %s\n", str);
free(str);
if (libinput_device_has_capability(dev,
LIBINPUT_DEVICE_CAP_TABLET_PAD))
print_pad_info(dev);
printf("\n");
}