diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2016-11-28 11:00:00 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-11-29 12:14:05 +1000 |
commit | cff370fcd0010329b0851f45c61aa26c22a5de78 (patch) | |
tree | 764bb544f726e8b97e4b79b8043bf31ca516eaf5 /tools | |
parent | 364621c001ab7cf52490b78d5cfb7e22cb7b1229 (diff) |
tools: print pointer axis source in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/event-debug.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/event-debug.c b/tools/event-debug.c index 5cd5915..3e038be 100644 --- a/tools/event-debug.c +++ b/tools/event-debug.c @@ -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 |