mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-02 19:10:10 +01:00
tools: print pointer axis source in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
364621c001
commit
cff370fcd0
1 changed files with 15 additions and 1 deletions
|
|
@ -365,6 +365,19 @@ print_pointer_axis_event(struct libinput_event *ev)
|
|||
double v = 0, h = 0;
|
||||
const char *have_vert = "",
|
||||
*have_horiz = "";
|
||||
const char *source = "invalid";
|
||||
|
||||
switch (libinput_event_pointer_get_axis_source(p)) {
|
||||
case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL:
|
||||
source = "wheel";
|
||||
break;
|
||||
case LIBINPUT_POINTER_AXIS_SOURCE_FINGER:
|
||||
source = "finger";
|
||||
break;
|
||||
case LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS:
|
||||
source = "continuous";
|
||||
break;
|
||||
}
|
||||
|
||||
if (libinput_event_pointer_has_axis(p,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL)) {
|
||||
|
|
@ -379,7 +392,8 @@ print_pointer_axis_event(struct libinput_event *ev)
|
|||
have_horiz = "*";
|
||||
}
|
||||
print_event_time(libinput_event_pointer_get_time(p));
|
||||
printf("vert %.2f%s horiz %.2f%s\n", v, have_vert, h, have_horiz);
|
||||
printf("vert %.2f%s horiz %.2f%s (%s)\n",
|
||||
v, have_vert, h, have_horiz, source);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue