Find a file
Paul Ausbeck cd3a229fbb evdev: add new high performance button invoked scrolling mode
This patch contains a new button invoked scrolling mode optimized for
use with 5 button mice. The preferred invokation button is the thumb
button, BTN_SIDE in evdev parlance. The initial direction of motion of
the mouse following press of the invoking button sets the scroll axis
and the sign of the subsequent scroll reports. Once set the axis and sign
of the scroll reports can only be changed by releasing and re-pressing
the invocation button. This scheme allows for arbitrarily long scroll
distances without lifting and replacing the mouse.

Only one axis is active for scrolling at a time. The preferred scroll
motion is circular, but any type of mouse motion is acceptable. The
distance scrolled is proportional to the manhattan distance moved by the
mouse. The dynamic range is expanded non-linearly based on movement
velocity such that the +-2^8 input range of mouse motion reports is
expanded to a +-2^16 range of scroll reports. The scheme takes maximum
advantage of the precision of the mouse, both arbitrarily slow and quite
fast scrolling are accommodated. The performance of the mode is such that
the scroll thumb is only needed for reference, it need never be "touched".

The mode is optimized for y axis use. The y axis is preferred in that axis
determination happens more easily for the y axis than for the x axis. This
is accomplished by creating a wider movement cone for y axis selection
than for x axis selection. Also, x axis selection can only begin following
a delay, now 250ms, from button press, whereas y axis selection is
immediate with as little dead/wasted movement as possible. The reason
for this asymmetry is personal. I find that when I am reflexively using
the mode I may move the mouse more to the left than I am intending,
particularly while I am simultaneously pressing the button and starting
motion. This behavior can result in x axis selection when y axis is
intended. Since I almost never scroll the x axis, I solved the problem
by heavily preferring the y axis. The more deliberate criteria for
selecting the x axis do not bother me at all. Of course I could have
defeated x axis selection entirely, but after significant use of the mode
I find the current setup to be almost foolproof for the y axis while
still allowing x selection without using up another button.

The mode is optimized for the internet browsing use case, following
hyperlinks and scrolling the resulting pages. Care is taken to assure
that the user is not confused by overloading the scroll modal button
with any other action. Once the new mode is assigned to a button,
that button cannot be used for any other purpose. Therefore, those that
are used to using mouse buttons 4 and 5 for their historical design use,
browsing forward and backward, may not initially take to the new mode.
However, patience might be rewarded sooner than one would think. At least
for some, the new mode easily becomes intuitive and automatic. And since
scrolling is performed far more frequently on modern systems than browsing
forward and backward, the increased efficiency of entering the scrolling
mode more than pays for the loss of button browsing behavior.

I've not before submitted code to the libinput project. Therefore I have
limited the changes to a single source file, evdev.c. Also, I have
conditioned the submitted changes so that the new mode is only operational
on devices that have the udev environment variable LIBINPUT_SIGNED_SCROLL
defined with a value of "1". An example udev rule to add such an
environment variable to a Microsoft 5-Button Mouse with IntelliEye follows:

ACTION=="add|change", KERNEL=="event[0-9]*", ENV{ID_VENDOR_ID}=="045e", \
ENV{ID_MODEL_ID}=="0039", ENV{LIBINPUT_SIGNED_SCROLL}="1"

I don't really know how to go about getting this change incorporated into
the libinput project. I've attempted to make the change in such a way as
to not interfere with any existing functionality. Further, I've made the
new functionality available only via the above not easily discoverable
incantation. In this way I'm hoping to get the change incorporated into
the main project so that others can somewhat easily try out the new mode.
Once people are comfortable that the new mode doesn't break anything, the
next step would be to make it more publicly usable via changes further
libinput changes plus changes to xorg-xf86-input-libinput and/or the
similar? wayland input driver.

Signed-off-by: Paul Ausbeck <paula@alumni.cse.ucsc.edu>
2021-11-03 16:37:08 -07:00
.gitlab/issue_templates gitlab issue templates: remove the checkmarks 2020-03-22 22:33:01 +00:00
.gitlab-ci test: use MESON_TESTTHREADS to determine the number of jobs 2021-08-03 22:14:29 +00:00
completion/zsh meson.build: use the / operator instead of join_paths 2021-08-03 20:00:37 +02:00
doc doc/user: fix broken link to systemd 60-evdev.hwdb 2021-10-30 12:10:10 +02:00
include include: update event codes to v5.8 2020-08-13 11:02:33 +10:00
quirks quirks: add quirk for GPD Win Max 2021-10-20 16:18:33 +02:00
src evdev: add new high performance button invoked scrolling mode 2021-11-03 16:37:08 -07:00
test test: use a plain libinput context for the log priority check 2021-10-19 13:05:00 +10:00
tools High-resolution scroll wheel support 2021-08-31 08:45:01 +02:00
udev using secure functions safe_strdup 2021-06-15 11:27:29 +08:00
.dir-locals.el indentation: add .dir-locals.el for emacs 2018-02-26 18:44:00 +10:00
.editorconfig editorconfig: add settings for meson files 2021-08-04 05:58:29 +00:00
.gitignore gitignore: ignore gnuplot files 2018-05-10 16:25:40 +10:00
.gitlab-ci.yml ci: update to GTK 4 when available 2021-08-03 16:52:39 +00:00
.vimdir Add .vimdir for libinput-specific settings 2015-05-25 09:17:29 +10:00
CODING_STYLE.md Expand the CODING_STYLE with an explanation of commit requirements 2019-12-05 10:40:37 +10:00
COPYING Change various references to the master branch to main 2021-04-29 01:31:03 +00:00
meson.build libinput 1.19.2 2021-10-21 14:19:49 +10:00
meson_options.txt meson.build: disable documentation by default 2021-08-03 12:11:09 +10:00
README.md Change various references to the master branch to main 2021-04-29 01:31:03 +00:00

libinput

libinput is a library that provides a full input stack for display servers and other applications that need to handle input devices provided by the kernel.

libinput provides device detection, event handling and abstraction to minimize the amount of custom input code the user of libinput needs to provide the common set of functionality that users expect. Input event processing includes scaling touch coordinates, generating relative pointer events from touchpads, pointer acceleration, etc.

User documentation

Documentation explaining features available in libinput is available here.

This includes the FAQ and the instructions on reporting bugs.

Source code

The source code of libinput can be found at: https://gitlab.freedesktop.org/libinput/libinput

For a list of current and past releases visit: https://www.freedesktop.org/wiki/Software/libinput/

Build instructions: https://wayland.freedesktop.org/libinput/doc/latest/building.html

Reporting Bugs

Bugs can be filed on freedesktop.org GitLab: https://gitlab.freedesktop.org/libinput/libinput/issues/

Where possible, please provide the libinput record output of the input device and/or the event sequence in question.

See https://wayland.freedesktop.org/libinput/doc/latest/reporting-bugs.html for more info.

Documentation

Examples of how to use libinput are the debugging tools in the libinput repository. Developers are encouraged to look at those tools for a real-world (yet simple) example on how to use libinput.

License

libinput is licensed under the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: [...]

See the COPYING file for the full license information.

About

Documentation generated from git commit GIT_VERSION