mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-30 17:40:11 +01:00
tools: print the button name for tablet button events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
c420747be4
commit
ecd6a0803e
1 changed files with 8 additions and 2 deletions
|
|
@ -304,12 +304,18 @@ print_tablet_button_event(struct libinput_event *ev)
|
|||
{
|
||||
struct libinput_event_tablet_tool *p = libinput_event_get_tablet_tool_event(ev);
|
||||
enum libinput_button_state state;
|
||||
const char *buttonname;
|
||||
int button;
|
||||
|
||||
print_event_time(libinput_event_tablet_tool_get_time(p));
|
||||
|
||||
button = libinput_event_tablet_tool_get_button(p);
|
||||
buttonname = libevdev_event_code_get_name(EV_KEY, button);
|
||||
|
||||
state = libinput_event_tablet_tool_get_button_state(p);
|
||||
printf("%3d %s, seat count: %u\n",
|
||||
libinput_event_tablet_tool_get_button(p),
|
||||
printf("%3d (%s) %s, seat count: %u\n",
|
||||
button,
|
||||
buttonname ? buttonname : "???",
|
||||
state == LIBINPUT_BUTTON_STATE_PRESSED ? "pressed" : "released",
|
||||
libinput_event_tablet_tool_get_seat_button_count(p));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue