libinput is a shared input stack for Wayland compositors
libinput can be used with the xf86-input-libinput driver
Version 1.0.0 released in Aug 26
Features added since XDC 2014:
edge scrolling, middle button scrolling, natural scrolling, scroll sources, configurable pointer speed, per-device acceleration methods, unaccelerated motion events, hovering fingers on touchpads, click method configuration, device capability queries, device groups, touchpad gestures, touchpad size required, disable-while-typing, tap drag-lock, thumb detection, usec timestamps
... and heaps of documentation
We're trying to use the stack below us, and fix it where needed.
The udev hwdb is a hard requirement.
udev decides the type of device
ID_INPUT_MOUSE
, ID_INPUT_TOUCHPAD
→ A single place in the system where device types are assigned.
Can be overridden by custom rules, locally or as part of other packages (e.g. libwacom).
Pointer acceleration constants
MOUSE_DPI
for hardware-resolution settingsPOINTINGSTICK_SENSITIVITY
adjusts kernel driver sensitivityPOINTINGSTICK_CONST_ACCEL
applies a base factorDevice models and attributes
LIBINPUT_MODEL_LENOVO_X230
LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD
LIBINPUT_MODEL_ATTR_SIZE_HINT
LIBINPUT_MODEL_ATTR_RESOLUTION_HINT
These are internal API, udev is only used as storage facility
Some devices have multiple kernel devices
libinput assigns a single struct libinput_device_group
struct libinput_device_group *g1, *g2;
g1 = libinput_device_get_device_group(dev1);
g2 = libinput_device_get_device_group(dev2);
if (g1 == g2)
printf("Same physical device\n");
All of libinput's internal handling is in mm
Touchpads must have x/y resolutions
defaults to 69x50mm where missing
LIBINPUT_MODEL_ATTR_SIZE_HINT
LIBINPUT_MODEL_ATTR_RESOLUTION_HINT
Tuning the algorithm
Different algorithms for different devices
A "flat" pointer acceleration profile
for high-dpi/switchable-dpi mice
no acceleration but a constant factor
dx/dy = dx/dx * factor
Swipe:
Pinch:
Click a button with a thumb while using the index
Touchpads don't provide enough information, pressure is surface size and doesn't work well at the edges
libinput's pointer axis events include a source
LIBINPUT_POINTER_AXIS_SOURCE_WHEEL
LIBINPUT_POINTER_AXIS_SOURCE_FINGER
LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS
No kinetic scrolling in libinput!
xf86-input-libinput is the X driver wrapper around libinput
A thin wrapper with almost no logic
Button logically down, when physically released