libinput update

Peter Hutterer

16 Sep 2015

libinput update

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

  • Installed by default in Fedora 22 and later

libinput update

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

libinput and udev

libinput and udev

We're trying to use the stack below us, and fix it where needed.

The udev hwdb is a hard requirement.

libinput and udev

udev decides the type of device

→ 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).

libinput and udev

Pointer acceleration constants

libinput and udev

Device models and attributes

These are internal API, udev is only used as storage facility

New Features

Device groups

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");

Touchpad size

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

Pointer acceleration

Tuning the algorithm

See the documentation

Pointer acceleration

Different algorithms for different devices

Pointer acceleration

A "flat" pointer acceleration profile

dx/dy = dx/dx * factor

Touchpad gestures

Swipe:

Touchpad gestures

Pinch:

Touchpad gestures

Thumb detection

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

Scroll sources

libinput's pointer axis events include a source

No kinetic scrolling in libinput!

xf86-input-libinput

xf86-input-libinput

xf86-input-libinput is the X driver wrapper around libinput

A thin wrapper with almost no logic

Button drag lock

Button logically down, when physically released

Horizontal scrolling

Future plans

Future plans