Difference between revisions of "Libinput"

From ArchWiki
Jump to navigation Jump to search
(Removed the link to `kcm-pointing-devices-git` because it has been abandoned: https://github.com/amezin/pointing-devices-kcm)
(Troubleshooting: Plasma touchpad KCM has now full support to libinput)
 
(11 intermediate revisions by 5 users not shown)
Line 14: Line 14:
 
:libinput is a library to handle input devices in Wayland compositors and to provide a generic X.Org input 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.
 
:libinput is a library to handle input devices in Wayland compositors and to provide a generic X.Org input 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.
  
The X.Org input driver supports most regular [[Xorg#Input devices]]. Particularly notable is the project's goal to provide advanced support for touch (multitouch and gesture) features of touchpads and touchscreens. See the [http://wayland.freedesktop.org/libinput/doc/latest/pages.html libinput documentation] for more information.
+
The X.Org input driver supports most regular [[Xorg#Input devices]]. Particularly notable is the project's goal to provide advanced support for touch (multitouch and gesture) features of touchpads and touchscreens. See the [https://wayland.freedesktop.org/libinput/doc/latest/ libinput documentation] for more information.
  
 
== Installation ==
 
== Installation ==
Line 33: Line 33:
  
 
First, execute:
 
First, execute:
 +
 
  # libinput list-devices
 
  # libinput list-devices
 +
 
It will output the devices on the system and their respective features supported by libinput.
 
It will output the devices on the system and their respective features supported by libinput.
  
Line 39: Line 41:
 
   
 
   
 
See {{man|4|libinput}} for general options to set and information about allowable values. The ''xinput'' tool is used to view or change options available for a particular device at runtime. For example:
 
See {{man|4|libinput}} for general options to set and information about allowable values. The ''xinput'' tool is used to view or change options available for a particular device at runtime. For example:
 +
 
  $ xinput list
 
  $ xinput list
 +
 
to view all devices and determine their names and numbers. In the following, {{ic|''device''}} is either the name or number identifying the device to operate with.
 
to view all devices and determine their names and numbers. In the following, {{ic|''device''}} is either the name or number identifying the device to operate with.
 +
 
  $ xinput list-props ''device''
 
  $ xinput list-props ''device''
 +
 
to view and  
 
to view and  
 +
 
  $ xinput set-prop ''device'' ''option-number'' ''setting''
 
  $ xinput set-prop ''device'' ''option-number'' ''setting''
 +
 
to change a setting. For example, to set both options of libinput Click Method Enabled (303), the following is issued:
 
to change a setting. For example, to set both options of libinput Click Method Enabled (303), the following is issued:
 +
 
  $ xinput set-prop 14 303 {1 1}
 
  $ xinput set-prop 14 303 {1 1}
  
 
=== Via Xorg configuration file ===
 
=== Via Xorg configuration file ===
  
See [[Xorg#Using .conf files]] for permanent option settings. [[Logitech Marble Mouse#Using libinput]]{{Broken section link}} and [[#Button re-mapping]] illustrate examples.
+
See [[Xorg#Using .conf files]] for permanent option settings. [[Logitech Marble Mouse#libinput]] and [[#Button re-mapping]] illustrate examples.
  
 
Alternative drivers for [[Xorg#Input devices]] can generally be installed in parallel. If you intend to switch driver for a device to use libinput, ensure no legacy configuration files {{ic|/etc/X11/xorg.conf.d/}} for other drivers take precedence.
 
Alternative drivers for [[Xorg#Input devices]] can generally be installed in parallel. If you intend to switch driver for a device to use libinput, ensure no legacy configuration files {{ic|/etc/X11/xorg.conf.d/}} for other drivers take precedence.
Line 69: Line 78:
 
[    28.878] (II) Using input driver 'libinput' for 'SynPS/2 Synaptics TouchPad'
 
[    28.878] (II) Using input driver 'libinput' for 'SynPS/2 Synaptics TouchPad'
 
[    28.886] (II) Using input driver 'libinput' for 'TPPS/2 IBM TrackPoint'
 
[    28.886] (II) Using input driver 'libinput' for 'TPPS/2 IBM TrackPoint'
[    28.895] (II) Using input driver 'libinput' for 'ThinkPad Extra Buttons'}}
+
[    28.895] (II) Using input driver 'libinput' for 'ThinkPad Extra Buttons'
 +
}}
  
 
is a notebook without any configuration files in {{ic|/etc/X11/xorg.conf.d/}}, i.e. devices are autodetected.
 
is a notebook without any configuration files in {{ic|/etc/X11/xorg.conf.d/}}, i.e. devices are autodetected.
Line 80: Line 90:
  
 
A basic configuration should have the following structure:
 
A basic configuration should have the following structure:
 +
 
{{hc|/etc/X11/xorg.conf.d/30-touchpad.conf|
 
{{hc|/etc/X11/xorg.conf.d/30-touchpad.conf|
 
Section "InputClass"
 
Section "InputClass"
Line 87: Line 98:
 
EndSection
 
EndSection
 
}}
 
}}
 +
 
You may define as many sections as you like in a single configuration file (usually one per input device).
 
You may define as many sections as you like in a single configuration file (usually one per input device).
 
To configure the device of your choice specify a filter by using one of the filters in the INPUTCLASS SECTION {{man|5|xorg.conf}}, e.g.
 
To configure the device of your choice specify a filter by using one of the filters in the INPUTCLASS SECTION {{man|5|xorg.conf}}, e.g.
 +
 
* {{ic|MatchIsPointer "on"}} (trackpoint)
 
* {{ic|MatchIsPointer "on"}} (trackpoint)
 
* {{ic|MatchIsKeyboard "on"}}
 
* {{ic|MatchIsKeyboard "on"}}
 
* {{ic|MatchIsTouchpad "on"}}
 
* {{ic|MatchIsTouchpad "on"}}
 
* {{ic|MatchIsTouchscreen "on"}}
 
* {{ic|MatchIsTouchscreen "on"}}
 +
 
The input device can then be configured with any of the lines in the CONFIGURATION DETAILS section of {{man|4|libinput}}. Common options include:
 
The input device can then be configured with any of the lines in the CONFIGURATION DETAILS section of {{man|4|libinput}}. Common options include:
 +
 
* {{ic|Option "Tapping" "on"}}: tapping a.k.a. tap-to-click
 
* {{ic|Option "Tapping" "on"}}: tapping a.k.a. tap-to-click
 
* {{ic|Option "ClickMethod" "clickfinger"}}: trackpad no longer has middle and right button areas and instead two-finger click is a context click and three-finger click is a middle click, see the [https://wayland.freedesktop.org/libinput/doc/latest/clickpad-softbuttons.html#clickfinger-behavior docs].
 
* {{ic|Option "ClickMethod" "clickfinger"}}: trackpad no longer has middle and right button areas and instead two-finger click is a context click and three-finger click is a middle click, see the [https://wayland.freedesktop.org/libinput/doc/latest/clickpad-softbuttons.html#clickfinger-behavior docs].
 
* {{ic|Option "NaturalScrolling" "true"}}: natural (reverse) scrolling
 
* {{ic|Option "NaturalScrolling" "true"}}: natural (reverse) scrolling
 
* {{ic|Option "ScrollMethod" "edge"}}: edge (vertical) scrolling
 
* {{ic|Option "ScrollMethod" "edge"}}: edge (vertical) scrolling
Bear in mind that some of them may only apply to certain devices and you'll need to restart X for changes to take effect.
+
 
 +
Bear in mind that some of them may only apply to certain devices and you will need to restart X for changes to take effect.
  
 
=== Graphical tools ===
 
=== Graphical tools ===
Line 110: Line 126:
 
** Similar to the GNOME UI, with more options.
 
** Similar to the GNOME UI, with more options.
 
* [[KDE Plasma]] 5:  
 
* [[KDE Plasma]] 5:  
** Set of keyboard, mouse, controller, and touch pad options. Some features are still placeholders.
+
** Keyboard, mouse and controller devices can be configured from System Settings.
** {{AUR|kcm-pointing-devices-git}} is a rewritten KCM for all input devices supported by libinput.
 
  
 
== Tips and tricks ==
 
== Tips and tricks ==
Line 133: Line 148:
  
 
For some devices it is desirable to change the button mapping. A common example is the use of a thumb button instead of the middle button (used in X11 for pasting) on mice where the middle button is part of the mouse wheel. You can query the current button mapping via:
 
For some devices it is desirable to change the button mapping. A common example is the use of a thumb button instead of the middle button (used in X11 for pasting) on mice where the middle button is part of the mouse wheel. You can query the current button mapping via:
 +
 
  $ xinput get-button-map ''device''
 
  $ xinput get-button-map ''device''
 +
 
where ''device'' is either the device name or the device ID, as returned by {{ic|xinput list}}. You can freely permutate the button numbers and write them back. Example:
 
where ''device'' is either the device name or the device ID, as returned by {{ic|xinput list}}. You can freely permutate the button numbers and write them back. Example:
 +
 
  $ xinput set-button-map ''device'' 1 6 3 4 5 0 7
 
  $ xinput set-button-map ''device'' 1 6 3 4 5 0 7
 +
 
In this example, we mapped button 6 to be the middle button and disabled the original middle button by assigning it to button 0.  
 
In this example, we mapped button 6 to be the middle button and disabled the original middle button by assigning it to button 0.  
 
This may also be used for [[Wayland]], but be aware both the ''device'' number and its button-map will be different. Hence, settings are not directly interchangeable.  
 
This may also be used for [[Wayland]], but be aware both the ''device'' number and its button-map will be different. Hence, settings are not directly interchangeable.  
Line 150: Line 169:
 
fi
 
fi
 
done
 
done
...</nowiki>}}
+
...
 +
</nowiki>}}
  
 
=== Change touchpad sensitivity ===
 
=== Change touchpad sensitivity ===
Line 158: Line 178:
 
Custom touchpad pressure values can be set via temporary local device quirks. See [https://wayland.freedesktop.org/libinput/doc/latest/device-quirks.html].
 
Custom touchpad pressure values can be set via temporary local device quirks. See [https://wayland.freedesktop.org/libinput/doc/latest/device-quirks.html].
  
{{Note|
+
{{Note|Quirks are an internal API and are not guaranteed to work in future libinput versions. Between versions 1.11 and 1.12, udev rules [https://wayland.freedesktop.org/libinput/doc/1.11.3/udev_config.html#hwdb] were replaced by {{ic|.quirk}} files [https://wayland.freedesktop.org/libinput/doc/latest/device-quirks.html].}}
Quirks are an internal API and are not guaranteed to work in future libinput versions. Between versions 1.11 and 1.12, udev rules [https://wayland.freedesktop.org/libinput/doc/1.11.3/udev_config.html#hwdb] were replaced by {{ic|.quirk}} files [https://wayland.freedesktop.org/libinput/doc/latest/device-quirks.html].
 
}}
 
  
 
=== Disable touchpad ===
 
=== Disable touchpad ===
Line 187: Line 205:
 
[https://github.com/iberianpig/fusuma Fusuma] is a multitouch gesture recognizer, written in [[Ruby]], which can be used as an alternative to libinput-gestures.
 
[https://github.com/iberianpig/fusuma Fusuma] is a multitouch gesture recognizer, written in [[Ruby]], which can be used as an alternative to libinput-gestures.
  
Install the {{ic|fusuma}} [[Ruby#RubyGems|Ruby gem]]:
+
Install {{pkg|xdotool}} and the {{ic|fusuma}} [[Ruby#RubyGems|Ruby gem]]:
  
 
  $ gem install fusuma
 
  $ gem install fusuma
Line 199: Line 217:
 
   3:  
 
   3:  
 
     left:  
 
     left:  
       shortcut: 'alt+Right'
+
       command: 'xdotool key alt+Right'
 
     right:  
 
     right:  
       shortcut: 'alt+Left'
+
       command: 'xdotool key alt+Left'
 
     up:  
 
     up:  
       shortcut: 'ctrl+shift+plus'
+
       command: 'xdotool key ctrl+shift+plus'
 
     down:  
 
     down:  
       shortcut: 'ctrl+minus'
+
       command: 'xdotool key ctrl+minus'
 
pinch:
 
pinch:
 
   in:
 
   in:
     shortcut: 'ctrl+shift+plus'
+
     command: 'xdotool key ctrl+shift+plus'
 
   out:
 
   out:
     shortcut: 'ctrl+minus'
+
     command: 'xdotool key ctrl+minus'
  
 
threshold:
 
threshold:
Line 224: Line 242:
  
 
Notice that the config is for three fingers swipe.
 
Notice that the config is for three fingers swipe.
 +
 +
==== Gebaar ====
 +
[https://github.com/Coffee2CodeNL/gebaar-libinput Gebaar] is another gesture recognizer.
 +
Unlike Fusuma, it doesn't support pinching (support is planned in the future though) and threshholds, but in addition to swiping left, right, up and down with 3/4 fingers, it also supports diagonal swipes, which Fusuma does not.
  
 
==== GnomeExtendedGestures ====
 
==== GnomeExtendedGestures ====
Line 230: Line 252:
  
 
== Troubleshooting ==
 
== Troubleshooting ==
 +
 
First, see whether executing {{ic|libinput debug-events}} can support you in debugging the problem, see {{man|1|libinput-debug-events}} for options.
 
First, see whether executing {{ic|libinput debug-events}} can support you in debugging the problem, see {{man|1|libinput-debug-events}} for options.
  
Line 239: Line 262:
  
 
Ensure the touchpad events are being sent to the GNOME desktop by running the following command:
 
Ensure the touchpad events are being sent to the GNOME desktop by running the following command:
 +
 
  $ gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled
 
  $ gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled
  
 
Additionally, GNOME may override certain behaviors, like turning off Tapping and forcing Natural Scrolling. In this case the settings must be adapted using GNOMEs {{ic|gsettings}} command line tool or a graphical frontend of your choice. For example if you wish to enable ''Tapping'' and disable ''Natural Scrolling'' for your user, adjust the touchpad key-values like the following:
 
Additionally, GNOME may override certain behaviors, like turning off Tapping and forcing Natural Scrolling. In this case the settings must be adapted using GNOMEs {{ic|gsettings}} command line tool or a graphical frontend of your choice. For example if you wish to enable ''Tapping'' and disable ''Natural Scrolling'' for your user, adjust the touchpad key-values like the following:
 +
 
  $ gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
 
  $ gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
 
  $ gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
 
  $ gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
 
=== Touchpad settings not taking effect in KDE's Touchpad KCM ===
 
 
KDE's Touchpad KCM has libinput support for [[Xorg]], but not all GUI settings are available yet. You may find that a setting such as ''Disable touchpad when typing'' has no effect and other options are greyed out. Until the support is extended, a workaround is to set the options manually with {{ic|xinput set-prop}}.
 
  
 
=== Touchpad not detected at all ===
 
=== Touchpad not detected at all ===
Line 257: Line 278:
 
  i8042.noloop i8042.nomux i8042.nopnp i8042.reset
 
  i8042.noloop i8042.nomux i8042.nopnp i8042.reset
  
== See also ==  
+
== See also ==
  
 
* [https://wayland.freedesktop.org/libinput/doc/latest/index.html libinput Wayland documentation]
 
* [https://wayland.freedesktop.org/libinput/doc/latest/index.html libinput Wayland documentation]
 
* [https://archive.fosdem.org/2015/schedule/event/libinput/attachments/slides/591/export/events/attachments/libinput/slides/591/libinput_xorg.pdf FOSDEM 2015 - libinput] - Hans de Goede on goals and plans of the project
 
* [https://archive.fosdem.org/2015/schedule/event/libinput/attachments/slides/591/export/events/attachments/libinput/slides/591/libinput_xorg.pdf FOSDEM 2015 - libinput] - Hans de Goede on goals and plans of the project
 
*[http://who-t.blogspot.com.au/ Peter Hutterer's Blog] - numerous posts on libinput from one of the project's hackers
 
*[http://who-t.blogspot.com.au/ Peter Hutterer's Blog] - numerous posts on libinput from one of the project's hackers

Latest revision as of 12:54, 28 May 2019

From the libinput wiki page:

libinput is a library to handle input devices in Wayland compositors and to provide a generic X.Org input 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.

The X.Org input driver supports most regular Xorg#Input devices. Particularly notable is the project's goal to provide advanced support for touch (multitouch and gesture) features of touchpads and touchscreens. See the libinput documentation for more information.

Installation

If you wish to use libinput under Wayland, there is nothing to do for installation. The libinput package should already be installed as a dependency of any graphical environment you use that has Wayland, and no additional driver is needed.

If you wish to use libinput with Xorg, install the xf86-input-libinput package, which is "a thin wrapper around libinput and allows for libinput to be used for input devices in X. This driver can be used as as drop-in replacement for evdev and synaptics." [1] In other words, other packages used for input with X (i.e., those prefixed with xf86-input-) can be replaced with this driver.

You may also want to install xorg-xinput to be able to change settings at runtime.

Configuration

For Wayland, there is no libinput configuration file. The configurable options depend on the progress of your desktop environment's support for them; see #Graphical tools.

For Xorg, a default configuration file for the wrapper is installed to /usr/share/X11/xorg.conf.d/40-libinput.conf. No extra configuration is necessary for it to autodetect keyboards, touchpads, trackpointers and supported touchscreens.

Via xinput

First, execute:

# libinput list-devices

It will output the devices on the system and their respective features supported by libinput.

After a restart of the graphical environment, the devices should be managed by libinput with default configuration, if no other drivers are configured to take precedence.

See libinput(4) for general options to set and information about allowable values. The xinput tool is used to view or change options available for a particular device at runtime. For example:

$ xinput list

to view all devices and determine their names and numbers. In the following, device is either the name or number identifying the device to operate with.

$ xinput list-props device

to view and

$ xinput set-prop device option-number setting

to change a setting. For example, to set both options of libinput Click Method Enabled (303), the following is issued:

$ xinput set-prop 14 303 {1 1}

Via Xorg configuration file

See Xorg#Using .conf files for permanent option settings. Logitech Marble Mouse#libinput and #Button re-mapping illustrate examples.

Alternative drivers for Xorg#Input devices can generally be installed in parallel. If you intend to switch driver for a device to use libinput, ensure no legacy configuration files /etc/X11/xorg.conf.d/ for other drivers take precedence.

Tip: If you have libinput and synaptics installed in parallel with default configuration (i.e. no files in /etc/X11/xorg.conf.d for either), synaptics will take precedence due to its higher numeric order 70- in the default installation directory. To avoid this, you can symlink the default libinput configuration (40-libinput.conf) to /etc/X11/xorg.conf.d/ where directory search order precedence over 70-synaptics.conf will take place instead:
# ln -s /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/40-libinput.conf
If you do have /etc/X11/xorg.conf.d/ configuration files for both, the libinput file must be ordered second; see Xorg#Using .conf files. If you want to disable libinput (and fallback to older drivers) - just remove the previously created symbolic link from /etc/X11/xorg.conf.d/.

One way to check which devices are managed by libinput is the xorg logfile. For example, the following:

$ grep -e "Using input driver 'libinput'" /path/to/Xorg.0.log
[    28.799] (II) Using input driver 'libinput' for 'Power Button'
[    28.847] (II) Using input driver 'libinput' for 'Video Bus'
[    28.853] (II) Using input driver 'libinput' for 'Power Button'
[    28.860] (II) Using input driver 'libinput' for 'Sleep Button'
[    28.872] (II) Using input driver 'libinput' for 'AT Translated Set 2 keyboard'
[    28.878] (II) Using input driver 'libinput' for 'SynPS/2 Synaptics TouchPad'
[    28.886] (II) Using input driver 'libinput' for 'TPPS/2 IBM TrackPoint'
[    28.895] (II) Using input driver 'libinput' for 'ThinkPad Extra Buttons'

is a notebook without any configuration files in /etc/X11/xorg.conf.d/, i.e. devices are autodetected.

Of course you can elect to use an alternative driver for one device and libinput for others. A number of factors may influence which driver to use. For example, in comparison to Touchpad Synaptics the libinput driver has fewer options to customize touchpad behaviour to one's own taste, but far more programmatic logic to process multitouch events (e.g. palm detection as well). Hence, it makes sense to try the alternative, if you are experiencing problems on your hardware with one driver or the other.

Custom configuration files should be placed in /etc/X11/xorg.conf.d/ and following a widely used naming schema 30-touchpad.conf is often chosen as filename.

Tip: Have a look at CONFIGURATION DETAILS in /usr/share/X11/xorg.conf.d/40-libinput.conf for guidance and refer to the libinput(4) manual page for a detailed description of available configuration options.

A basic configuration should have the following structure:

/etc/X11/xorg.conf.d/30-touchpad.conf
Section "InputClass"
    Identifier "devname"
    Driver "libinput"
    ...
EndSection

You may define as many sections as you like in a single configuration file (usually one per input device). To configure the device of your choice specify a filter by using one of the filters in the INPUTCLASS SECTION xorg.conf(5), e.g.

  • MatchIsPointer "on" (trackpoint)
  • MatchIsKeyboard "on"
  • MatchIsTouchpad "on"
  • MatchIsTouchscreen "on"

The input device can then be configured with any of the lines in the CONFIGURATION DETAILS section of libinput(4). Common options include:

  • Option "Tapping" "on": tapping a.k.a. tap-to-click
  • Option "ClickMethod" "clickfinger": trackpad no longer has middle and right button areas and instead two-finger click is a context click and three-finger click is a middle click, see the docs.
  • Option "NaturalScrolling" "true": natural (reverse) scrolling
  • Option "ScrollMethod" "edge": edge (vertical) scrolling

Bear in mind that some of them may only apply to certain devices and you will need to restart X for changes to take effect.

Graphical tools

There are different GUI tools:

Tips and tricks

Button re-mapping

Swapping two- and three-finger tap for a touchpad is a straight forward example. Instead of the default three-finger tap for pasting you can configure two-finger tap pasting by setting the TappingButtonMap option in your Xorg configuration file. To set 1/2/3-finger taps to left/right/middle set TappingButtonMap to lrm, for left/middle/right set it to lmr.

/etc/X11/xorg.conf.d/30-touchpad.conf
Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "Tapping" "on"
    Option "TappingButtonMap" "lmr"
EndSection

Remember to remove MatchIsTouchpad "on" if your device is not a touchpad and adjust the Identifier accordingly.

Manual button re-mapping

For some devices it is desirable to change the button mapping. A common example is the use of a thumb button instead of the middle button (used in X11 for pasting) on mice where the middle button is part of the mouse wheel. You can query the current button mapping via:

$ xinput get-button-map device

where device is either the device name or the device ID, as returned by xinput list. You can freely permutate the button numbers and write them back. Example:

$ xinput set-button-map device 1 6 3 4 5 0 7

In this example, we mapped button 6 to be the middle button and disabled the original middle button by assigning it to button 0. This may also be used for Wayland, but be aware both the device number and its button-map will be different. Hence, settings are not directly interchangeable.

Tip: You can use xev (from the xorg-xev package) to find out which physical button is currently mapped to which ID.

Some devices occur several times under the same device name, with a different amount of buttons exposed. The following is an example for reliably changing the button mapping for a Logitech Revolution MX mouse via xinitrc:

~/.xinitrc
...
for i in $(xinput list | grep "Logitech USB Receiver" | perl -n -e'/id=(\d+)/ && print "$1\n"')
	do if xinput get-button-map "$i" 2>/dev/null| grep -q 20; then
		xinput set-button-map "$i" 1 17 3 4 5 8 7 6 9 10 11 12 13 14 15 16 2 18 19 20
	fi
done
...

Change touchpad sensitivity

The method of finding the correct thresholds for when libinput registers a touch as DOWN and back UP again can be found [2] in the upstream documentation.

Custom touchpad pressure values can be set via temporary local device quirks. See [3].

Note: Quirks are an internal API and are not guaranteed to work in future libinput versions. Between versions 1.11 and 1.12, udev rules [4] were replaced by .quirk files [5].

Disable touchpad

To disable the touchpad, first get its name with xinput list and then disable it with xinput disable name.

Note:
  • It is more robust to disable it by name than by ID number. The devices may be renumbered.
  • It will be necessary to quote the name if it contains spaces.

To make it permanent, see Autostarting.

Gestures

While the libinput driver already contains logic to process advanced multitouch events like swipe and pinch gestures, the Desktop environment or Window manager might not have implemented actions for all of them yet.

libinput-gestures

For EWMH (see also wm-spec) compliant window managers, the libinput-gestures utility can be used meanwhile. The program reads libinput gestures (through libinput debug-events) from the touchpad and maps them to gestures according to a configuration file. Hence, it offers some flexibility within the boundaries of libinput's built-in recognition.

To use libinput-gestures, install the libinput-gesturesAUR package. You can use the default system-wide configured swipe and pinch gestures or define your own in a personal configuration file, see the README for details.

fusuma

Fusuma is a multitouch gesture recognizer, written in Ruby, which can be used as an alternative to libinput-gestures.

Install xdotool and the fusuma Ruby gem:

$ gem install fusuma

Alternatively an outdated version is available in the AUR: ruby-fusumaAUR.

then in ~/.config/fusuma/config.yml you can set something like:

~/.config/fusuma/config.yml
swipe:
  3: 
    left: 
      command: 'xdotool key alt+Right'
    right: 
      command: 'xdotool key alt+Left'
    up: 
      command: 'xdotool key ctrl+shift+plus'
    down: 
      command: 'xdotool key ctrl+minus'
pinch:
  in:
    command: 'xdotool key ctrl+shift+plus'
  out:
    command: 'xdotool key ctrl+minus'

threshold:
  swipe: 0.5
  pinch: 0.2

interval:
  swipe: 0.2
  pinch: 0.2

The swipe threshold is important for not swiping back too many pages.

Notice that the config is for three fingers swipe.

Gebaar

Gebaar is another gesture recognizer. Unlike Fusuma, it doesn't support pinching (support is planned in the future though) and threshholds, but in addition to swiping left, right, up and down with 3/4 fingers, it also supports diagonal swipes, which Fusuma does not.

GnomeExtendedGestures

For deeper integration with GNOME, there is GnomeExtendedGestures (gnome-shell-extension-extended-gestures-gitAUR). Three finger horizontal and vertical gestures can be configured to perform gnome-shell actions (such as toggling the application overview or cycling between them).

Troubleshooting

First, see whether executing libinput debug-events can support you in debugging the problem, see libinput-debug-events(1) for options.

Some inputs require kernel support. The tool evemu-describe from the evemu package can be used to check:

Compare the output of software supported input trackpad driver with a supported trackpad. i.e. a couple of ABS_ axes, a couple of ABS_MT axes and no REL_X/Y axis. For a clickpad the INPUT_PROP_BUTTONPAD property should also be set, if it is supported.

Touchpad not working in GNOME

Ensure the touchpad events are being sent to the GNOME desktop by running the following command:

$ gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled

Additionally, GNOME may override certain behaviors, like turning off Tapping and forcing Natural Scrolling. In this case the settings must be adapted using GNOMEs gsettings command line tool or a graphical frontend of your choice. For example if you wish to enable Tapping and disable Natural Scrolling for your user, adjust the touchpad key-values like the following:

$ gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
$ gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false

Touchpad not detected at all

Tango-go-next.pngThis article or section is a candidate for moving to Laptop#Touchpad.Tango-go-next.png

Notes: Not a libinput issue. An explanation of the parameters is linked in Touchpad_Synaptics#No_Multi-touch_in_some_Elantech_touchpads, which is much better than saying "try some of these". (Discuss in Talk:Libinput#)

If a touchpad device is not detected and shown as a device at all, a possible solution might be using one or more of these kernel parameters.

i8042.noloop i8042.nomux i8042.nopnp i8042.reset

See also