pointer: add high-resolution axis event

Starting with Linux Kernel v5.0 two new axes are available for
mice that support high-resolution wheel scrolling: REL_WHEEL_HI_RES and
REL_HWHEEL_HI_RES.

Both axes send data in fractions of 120 where each multiple of 120
amounts to one logical scroll event. Fractions of 120 indicate a wheel
movement less than one detent.

Three new events are now available on libinput:
LIBINPUT_EVENT_POINTER_SCROLL_WHEEL,
LIBINPUT_EVENT_POINTER_SCROLL_FINGER, and
LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS.
These events replace the LIBINPUT_EVENT_POINTER_AXIS event, so new
clients should simply ignore that event.

Also, two new APIs are available to access the high-resolution data:
libinput_event_pointer_get_scroll_value() and
libinput_event_pointer_get_scroll_value_v120().

Create a new event, wlr_event_pointer_axis_v120, to represent
high-resolution axis events and a signal to emit them:
wlr_pointer->pointer.axis_value120.
This commit is contained in:
José Expósito 2021-09-20 19:45:48 +02:00
parent 9579d62a16
commit d0b8c111fd
2 changed files with 11 additions and 0 deletions

View file

@ -11,6 +11,7 @@ void wlr_pointer_init(struct wlr_pointer *pointer,
wl_signal_init(&pointer->events.motion_absolute);
wl_signal_init(&pointer->events.button);
wl_signal_init(&pointer->events.axis);
wl_signal_init(&pointer->events.axis_value120);
wl_signal_init(&pointer->events.frame);
wl_signal_init(&pointer->events.swipe_begin);
wl_signal_init(&pointer->events.swipe_update);