Single tap with touchpad from console
After installing Ubuntu touchpad’s single tap feature may be missing as it is disable by default1 in devices where tapping isn’t the only method to trigger button clicks.
“Tapping” or “tap-to-click” is the name given to the behavior where a short finger touch down/up sequence maps into a button click. This is most commonly used on touchpads, but may be available on other devices.
In Ubuntu, mouse and touchpad devices are controlled by libinput.
libinput is an input stack for processes that need to provide events from commonly used input devices. That includes mice, keyboards, touchpads, touchscreens and graphics tablets. libinput handles device-specific quirks and provides an easy-to-use API to receive events from devices.
In this guide we will enable the tapping feature under the X11 environment via the command line.
1. Find touchpad device id
We will use xinput command to activate it,
xinput is an
“utility to configure and test X input devices”2
We will list all the pointer input devices by filtering input devices marked as pointers:
$ xinput list | grep pointer ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Synaptics TM2976-002 id=15 [slave pointer (2)]
In this case I have it as the id
2. Identify tapping code
$ xinput list-props 15 | grep Tapping libinput Tapping Enabled (320): 0 libinput Tapping Enabled Default (321): 0 libinput Tapping Drag Enabled (322): 1 libinput Tapping Drag Enabled Default (323): 1 libinput Tapping Drag Lock Enabled (324): 0 libinput Tapping Drag Lock Enabled Default (325): 0 libinput Tapping Button Mapping Enabled (326): 1, 0 libinput Tapping Button Mapping Default (327): 1, 0
We see that “Tapping Enable” value is 0 and its code is 320.
3. Activate single tap
We activate tapping by using
xinput set-prop parameter to set the
above feature as 1
$ xinput set-prop 15 320 1
4. Make this permament
To persist changes after reboot, we need to modify
System wide configuration file is located at
/etc/X11/xinit/xinputrc3. The above location is preferred
~/.xinputrc where you would just activate the tap button for a
$ echo "xinput set-prop 15 320 1" | sudo tee -a /etc/X11/xinit/xinputrc [sudo] password for user: xinput set-prop 15 320 1 $ cat /etc/X11/xinit/xinputrc # im-config(8) generated on Sun, 30 Mar 2014 02:45:02 +0900 run_im default # im-config signature: d57688c8151277a0c25d15aa0523da6b - xinput set-prop 15 320 1
Tapping is disabled by default on most devices: https://gitlab.freedesktop.org/libinput/libinput/commit/2219c12c3 ↩︎
man page definition ↩︎
- How to activate tap to click touchpad's feature in Ubuntu in 4 steps
- Difference between suspend and hibernate in Ubuntu and how to execute them from command lineApril 12, 2020
- Solving Google Chrome's gpu-process error message in Ubuntu LinuxJanuary 7, 2019
- Solving Google Chrome's secret service operation error message in Ubuntu LinuxJanuary 7, 2019
- Start Emacs In Ubuntu The Right WayJune 10, 2017