Libinput

libinput is an input device driver for Wayland compositors and X.org window system. It is Article description::Gentoo Linux' default input device driver. It provides device detection, device handling, input device event processing and abstraction so minimize the amount of custom input code compositors need to provide the common set of functionality that users expect.

Kernel
Support for Event interface ( CONFIG_INPUT_EVDEV ) needs to be enabled in the kernel:

USE flags
Some packages are aware of the USE flag. It should already be set as the default input device driver by the make.defaults file.

To check if it is presently activated, run:

If not, add it to the INPUT_DEVICES  variable:

After the update the packages and  should be installed.

Additional software
In order to enable actions gestures on the touchpad using the libinput driver, follow the install notes from the official project page on GitHub.

Remember to install the required dependencies:

Xorg
By default, when libinput is the only available input driver for Xorg, no additional configuration is needed. Simply (re)start the graphical environment for the changes to take effect.

If multiple input drivers are available on the system ( and for example), then additional configuration is required.

Selecting libinput
When multiple drivers are available on the system, Xorg must be instructed to use libinput before trying to use other input drivers. This can be simply performed by symlinking the file into the  directory:

If the will be edited, it is better to copy the file to the configuration directory:

Xorg gives priority to the files in the directory.

(Re)start the graphical environment for the changes to take effect.

Touchpad tap-to-click
Many users will desire the native 'tap-to-click" behavior for laptops with modern touchpads. Add the following Option lines to Xorg's libinput configuration section:

Acceleration
Reducing acceleration.

More information under manual page.

The corresponding real-time test can be done using. For example, for a Logitech G300s mouse :

Invocation
To list the available input devices:

For detailed information see the man page.

Removing another input driver from INPUT_DEVICES does not prevent Xorg from loading it
This issue can occur in a variety of situations, but it is most prominent when migrating from evdev to libinput.

Be sure the package is no longer installed on the system. If exists then Xorg will still reference it.

Verify the evdev driver is no longer referenced anywhere by Portage (check and ), then depclean the system:

External resources

 * Latest libinput API documentation
 * Gentoo forums discussion on libinput
 * Arch Linux wiki article on libinput
 * profiles: Switch default INPUT_DEVICES to libinput on Linux.