• Peter Hutterer's avatar
    Add LIBINPUT_EVENT_POINTER_AXIS_WHEEL to get normalized wheel scrolling · 122f8225
    Peter Hutterer authored
    Starting with kernel v5.0 two new axes are available for 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.
    
    This commit adds a new API for pointer axis events. A new event type and a new
    API to get a normalized-to-120 value also used by Windows and the kernel, each
    multiple of 120 represents a logical scroll click.
    
    This addresses a main shortcoming with the existing API - it was unreliable to
    calculate the click angle based on the axis value+discrete events and thus any
    caller using the axis value alone would be left with some ambiguity. With the
    v120 API it's now possible to (usually) calculate the click angle, but more
    importantly it provides the simplest hw-independent way of scrolling by a
    click or a fraction of a click.
    
    A new event type is required, the only way to integrate the v120 value
    otherwise was to start sending events with a discrete value of 0. This
    would break existing xf86-input-libinput (divide by zero, fixed in 0.28.2) and
    weston (general confusion). mutter, kwin are unaffected.
    
    Notable: REL_WHEEL/REL_HWHEEL are emulated by the kernel but there's no
    guarantee that they'll come every accumulated 120 values, e.g. Logitech mice
    often send events that don't add up to 120 per detent.
    
    We use the kernel's wheel click emulation instead of doing our own.
    Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
    122f8225
Name
Last commit
Last update
.gitlab/issue_templates Loading commit data...
ci Loading commit data...
doc Loading commit data...
include/linux Loading commit data...
quirks Loading commit data...
src Loading commit data...
test Loading commit data...
tools Loading commit data...
udev Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
.vimdir Loading commit data...
CODING_STYLE.md Loading commit data...
COPYING Loading commit data...
README.md Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...