mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-06 02:18:06 +02:00
tools: print which scroll axis we have in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
eb1197899e
commit
3d39dbc3f2
1 changed files with 9 additions and 3 deletions
|
|
@ -270,17 +270,23 @@ print_axis_event(struct libinput_event *ev)
|
||||||
{
|
{
|
||||||
struct libinput_event_pointer *p = libinput_event_get_pointer_event(ev);
|
struct libinput_event_pointer *p = libinput_event_get_pointer_event(ev);
|
||||||
double v = 0, h = 0;
|
double v = 0, h = 0;
|
||||||
|
const char *have_vert = "",
|
||||||
|
*have_horiz = "";
|
||||||
|
|
||||||
if (libinput_event_pointer_has_axis(p,
|
if (libinput_event_pointer_has_axis(p,
|
||||||
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL))
|
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL)) {
|
||||||
v = libinput_event_pointer_get_axis_value(p,
|
v = libinput_event_pointer_get_axis_value(p,
|
||||||
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||||
|
have_vert = "*";
|
||||||
|
}
|
||||||
if (libinput_event_pointer_has_axis(p,
|
if (libinput_event_pointer_has_axis(p,
|
||||||
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL))
|
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL)) {
|
||||||
h = libinput_event_pointer_get_axis_value(p,
|
h = libinput_event_pointer_get_axis_value(p,
|
||||||
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
||||||
|
have_horiz = "*";
|
||||||
|
}
|
||||||
print_event_time(libinput_event_pointer_get_time(p));
|
print_event_time(libinput_event_pointer_get_time(p));
|
||||||
printf("vert %.2f horiz %.2f\n", v, h);
|
printf("vert %.2f%s horiz %.2f%s\n", v, have_vert, h, have_horiz);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue