mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-24 19:20:05 +01:00
test: don't try to print axis values that aren't set
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
254f87564f
commit
2ee2bebb34
1 changed files with 11 additions and 6 deletions
|
|
@ -1834,12 +1834,17 @@ litest_print_event(struct libinput_event *event)
|
|||
break;
|
||||
case LIBINPUT_EVENT_POINTER_AXIS:
|
||||
p = libinput_event_get_pointer_event(event);
|
||||
fprintf(stderr,
|
||||
"vert %.f horiz %.2f",
|
||||
libinput_event_pointer_get_axis_value(p,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL),
|
||||
libinput_event_pointer_get_axis_value(p,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL));
|
||||
x = 0.0;
|
||||
y = 0.0;
|
||||
if (libinput_event_pointer_has_axis(p,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL))
|
||||
y = libinput_event_pointer_get_axis_value(p,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||
if (libinput_event_pointer_has_axis(p,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL))
|
||||
x = libinput_event_pointer_get_axis_value(p,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
||||
fprintf(stderr, "vert %.f horiz %.2f", y, x);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue