mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 14:00:06 +01:00
tools: print button/ring/strip info for pads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
4f8088066c
commit
b2772abb46
1 changed files with 19 additions and 0 deletions
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue