How to activate tap to click touchpad's feature in Ubuntu in 4 steps

Single tap with touchpad from console

Published:

Overview

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 15.

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 xinputrc.

System wide configuration file is located at /etc/X11/xinit/xinputrc3. The above location is preferred over ~/.xinputrc where you would just activate the tap button for a single user.


$  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

References


  1. Tapping is disabled by default on most devices: https://gitlab.freedesktop.org/libinput/libinput/commit/2219c12c3 ↩︎

  2. man page definition ↩︎

  3. https://manpages.ubuntu.com/manpages/bionic/en/man8/im-config.8.html ↩︎

Uruguay
Marcelo Canina
I'm Marcelo Canina, a developer from Uruguay. I build websites and web-based applications from the ground up and share what I learn here.
comments powered by Disqus


Guide to enable single tap in touchpad using Ubuntu's terminal. How to activate it and make it permanent.

Clutter-free software concepts.
Translations English Español

Except as otherwise noted, the content of this page is licensed under CC BY-NC-ND 4.0 . Terms and Policy.

Powered by SimpleIT Hugo Theme

·