1. Overview
In this tutorial, we’ll present three command-line methods for enabling as well as disabling touchpad scrolling and tapping in Linux: xinput, libinput, and synclient.
2. Using xinput Command
xinput is a tool that allows users to see a list of input devices, get details about a specific device, and modify its settings. We can type the command xinput in the terminal to list all input devices connected with the system:
$ xinput
Now we need to find the ID of the touchpad device from the list of input devices. Commonly used names for the touchpad device are SynPS/2 Synaptics TouchPad and DLL06E4:01 06CB:7A13 Touchpad:
Furthermore, in order to find the ID of the property that controls scrolling, we can use the grep command:
$ xinput list-props [touchpad ID] | grep "Scrolling Distance"
Similarly, we can find the ID of the property that controls touchpad tapping:
$ xinput list-props [touchpad ID] | grep "Tapping Enabled"
Now we can use the touchpad ID and scrolling property ID to disable touchpad scrolling:
$ xinput set-prop [touchpad ID] [scrolling property ID] 0 0 0
To enable the touchpad scrolling, we need to set the scrolling property ID to 1.
In the same way, we can disable touchpad tapping:
$ xinput set-prop [touchpad ID] [tapping property ID] 0
Finally, we can enable touchpad taping by setting the tapping property ID to 1.
3. Using libinput Command
libinput is a Linux command line utility that provides a unified input API for devices such as touchpads, keyboards, and mice. Its main purpose is to manage input events and offer a consistent way to configure input devices across different Linux distributions.
First, we list all input devices connected to the system:
$ libinput list-devices
Next, we need to find the ID of the touchpad device from the list of input devices connected to the system:
Using the ID of the touchpad device, we can list the properties:
$ libinput list-props [touchpad ID]
To disable touchpad scrolling, we can use the libinput command and provide the touchpad ID:
$ libinput debug-events --device [touchpad ID] disable-scrolling
To enable the touchpad scrolling, instead of using the disable-scrolling option, we need to use the enable-scrolling option.
Similarly, we can disable touchpad tapping:
$ libinput debug-events --device [touchpad ID] disable-tap
Finally, we need to use the enable-tap option instead of the disable-tap to enable the touchpad tapping.
4. Using synclient Command
synclient command is used for Synaptics touchpads on Linux systems. It allows users to configure and control various settings of their touchpad.
Now, in order to enable or disable touchpad scrolling as well as tapping, the first step is to list the current touchpad settings:
$ synclient -l
Furthermore, we can disable touchpad scrolling using the synclient command:
$ synclient VertScrollDelta=0 HorizScrollDelta=0
By setting VertScrollDelta and HorizScrollDelta to 0, we can disable touchpad scrolling in both directions. This can be useful for users who prefer to use other methods for scrolling, such as keyboard shortcuts or external mice.
In the same way, we can disable touchpad tapping:
$ synclient TapButton1=0 TapButton2=0 TapButton3=0
The code effectively disables touchpad tapping by setting all three options to 0. In such a case, users must use the physical buttons on the touchpad to click rather than tapping on the touchpad itself. Additionally, this command only affects the current session and doesn’t permanently disable touchpad tapping.
5. Conclusion
In this tutorial, we presented three methods to enable and disable touchpad scrolling as well as tapping using the command line in Linux: xinput, libinput, and synclient.