Generated by GPT-5-mini| libinput | |
|---|---|
| Name | libinput |
| Developer | Wayland project contributors |
| Released | 2013 |
| Operating system | Linux kernel |
| License | MIT License |
libinput
libinput is a userspace input handling library used by Wayland compositors and X.Org Server via wrappers. It consolidates input handling for keyboards, mice, touchpads, touchscreens, and tablet devices to provide consistent behavior across GNOME, KDE, Sway, and other compositors. libinput aims to unify features previously split among projects including evdev, X.Org Server, and custom compositor input code.
libinput centralizes low-level input event processing for environments that use Wayland or integrate with X.Org Server compatibility layers. It interacts with the Linux kernel input subsystem and layers such as evdev and udev to enumerate and manage devices. The library is used by projects like GNOME, KDE, Sway, Weston, Enlightenment, and session managers including systemd-integrated environments.
libinput's architecture interfaces with the Linux kernel via evdev nodes and relies on udev device properties supplied by systemd. Core components include device discovery, event dispatch, filtering, gesture recognition, and calibration modules. The project exposes APIs consumed by compositors such as Weston, GNOME Shell, KWin, and display servers like X.Org Server through wrappers such as xf86-input-libinput. For pointer handling, libinput implements algorithms similar to those used by Synaptics drivers and borrows design patterns from input stacks in Android and macOS pointer acceleration subsystems. Gesture recognition supports multi-finger gestures comparable to implementations in Apple Inc. and Microsoft frameworks.
libinput supports a range of hardware produced by companies like Logitech, Lenovo, Dell, HP, Wacom, Synaptics, Elan Microelectronics, Apple Inc., and Microsoft. Supported device classes include USB and Bluetooth mice, keyboards from Cherry, touchpads using Synaptics and Elantech protocols, touchscreens from Elo Touch Solutions, and tablets by Wacom. Features encompass pointer acceleration, scroll methods (edge, two-finger, button), tap-to-click emulation for touchpads, palm detection inspired by Wacom heuristics, middle-button emulation, button mapping, and multi-touch gesture detection comparable to Apple Inc. and Google implementations. libinput also handles specialized inputs such as joystick-style devices and gaming peripherals from Razer and SteelSeries via the generic evdev interface.
libinput exposes a C API consumed by compositors like Weston, KWin, and Mutter inside GNOME Shell. Configuration is intentionally limited to encourage consistent defaults across environments; exposed options include device-specific settings discoverable via udev attributes and runtime parameters manageable by compositors or utilities like libinput-tools and graphical frontends created by GNOME and KDE. The API presents device objects, event sources, and dispatch hooks, requiring integration with mainloops such as those used by GLib and libev. For X compatibility, the driver xf86-input-libinput integrates with the X.Org Server input module architecture, mapping libinput semantics onto the XInput protocol.
libinput originated around 2013 as a response to fragmentation in Linux input handling between X.Org drivers, desktop environments like GNOME and KDE, and Wayland compositor-specific codebases. Early contributors included developers from Red Hat, Collabora, Intel Corporation, and SUSE. The project evolved through discussions at conferences such as FOSDEM and X.Org Developer Conference, with design influences from evdev and commercial drivers by Synaptics and Wacom. Key milestones include initial releases supporting core pointer and touchpad features, upstreaming of xf86-input-libinput into X.Org Server, and ongoing work adding gesture and tilt support for tablet devices. Maintenance is coordinated via repositories hosted by organizations like freedesktop.org and community-driven code review workflows.
Adoption spans major desktop environments and compositors: GNOME uses libinput through Mutter, KDE integrates via KWin, tiling compositors such as Sway and i3wm-adjacent projects rely directly on libinput, and display servers supporting X.Org Server use xf86-input-libinput. Device configuration utilities and GUIs from GNOME and KDE interact with libinput settings. Distributions including Debian, Ubuntu, Fedora, Arch Linux, openSUSE, and Gentoo Linux ship libinput as the default input stack for Wayland sessions. Integration efforts also involve graphics stacks like Mesa, compositors such as Weston and Enlightenment, and firmware projects like Coreboot where consistent input behavior is tested.