User:ScotXW/libinput



libinput is a library that handles input devices for display servers and other applications that need to directly deal with input devices.

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

An incomplete list of features: middle mouse button emulation, middle-button scrolling on tracksticks, software button areas for clickpads, clickfinger-like behavior, two-finger and edge scrolling, touchpad gestures, device-specific pointer acceleration, touchpad accidental palm and thumb detection, multi-finger tapping.

With Wayland aiming to be the core of the future graphics stack, an input system was needed for Wayland compositors. A single input stack has the advantage that we don't have different bugs and features in every compositor.

The current stack used in Xorg is a conglomerate of independent pieces. The two most common drivers, evdev and synaptics, cannot talk to each other and have accumulated significant amount of cruft. The drivers are effectively untestable. Changing the drivers to be compatible with Wayland compositors is effectively a rewrite.

So we needed a new solution, and libinput is that solution. It handles all input devices and configuration. With the xf86-input-libinput driver it can be used as the backend on X devices.


 * X.Org Server 1.18 shiped with the modesetting video driver integrated into the server for basic video functionality.
 * For X.Org Server 1.20 we want to integrate the libinput-wrapper input driver into the server as well.

Libinput handles input devices for multiple Wayland compositors and also provides a generic X.Org Server input driver. It aims to provide one implementation for multiple Wayland compositors with a common way to handle input events while minimizing the amount of custom input code compositors need to include. libinput provides device detection (via udev), device handling, input device event processing and abstraction.

Version 1.0 of libinput followed version 0.21, and included support for tablets, button sets and touchpad gestures. This version will maintain stable API/ABI.

As GNOME/GTK+ and KDE Frameworks 5 have mainlined the required changes, Fedora 22 will replace X.Org's evdev and Synaptics drivers with libinput.

With version 1.16, the X.Org Server obtained support for the libinput library in form of a wrapper called xf86-input-libinput.

Rationale
The original code if libinput started as part of Weston. One rationale of taking the code out of Weston and making it the libinput library was to avoid code duplication as well as different bugs and features in the Wayland compositors.

The other rationale was to avoid of a huge testing matrix.

Documentation
The libinput source code tarballs contain documentation written by the developers themselves! Unpacked Lininput release 1.5.3 comprises of 11 MB with the doc-directory taking up 7 MB.

High-level documentation is maintained at: https://wayland.freedesktop.org/libinput/doc/latest/pages.html

Additionally a couple of presentations/talks have been held at several X.Org Developer’s Conferences and there are also some blog entries.

udev
libinput relies on udev to do device detection and support for hot-plugging. libinput maintains its own set of udev rules in the directory udev.

Wayland
Most – if not all – available Wayland compositors make use of libinput. See List_of_display_servers.

X11

 * X.Org Server 1.16 (released 17 July 2014) obtained support for the libinput library in form of a wrapper called xf86-input-libinput.
 * X.Org Server 1.18 shipped with the mode setting video driver integrated into the server for basic video functionality.
 * For X.Org Server 1.20 (to be released in 2017) we want to integrate the libinput-wrapper input driver into the server as well.
 * Xephyr: ?

Other

 * Mir (software) exclusively relies on libinput.
 * There seems to be an ongoing effort to port libinput to Android.
 * Firefox OS: ?
 * Chrome OS: ?
 * mer integrates with Wayland, so the Wayland compositor probably exclusively relies on libinput

History
The Weston code for handling input devices (keyboards, pointers, touch screens, etc.) was split into its own separate library, called libinput, for which support was first merged in Weston 1.5.

Release history
1 The size refers to the entire software tarred and then packed with xz. Unpacked release 1.5.3 has a size of about 11 MB with the src-directory taking up about 800KiB. The rest is documentation (about 7 MB), tests ( 1.2MB) and other stuff.