Touchpad is too sensitive? Here’s a step by step guide shows how to detect the touchpad pressure values and change the sensitivity accordingly in recent Ubuntu with default libinput driver.
I’ve written about how to adjust touchpad scrolling speed in Ubuntu with Wayland and libinput. And, this one is for the touchpad mouse movement, tap down and up sensitivity.
Step 1: Install libinput-tools
Libinput has some command line tools for debugging, measuring, analyzing input devices in Linux.
To install the tool, press Ctrl+Alt+T
on keyboard to open terminal, and run command:
sudo apt install libinput-tools
Run sudo apt update
first to refresh package cache if package not found. And for Fedora, the package name is “libinput-utils”
Step 2: Measure Touchpad Pressure
1. After installed the tools, run the command below to start measuring the touchpad pressure values when you tapping on it.
sudo libinput measure touchpad-pressure
As you see in the screenshot below, the default values are 10, 8, 130, 255 in my case. And, they mean:
- tap DOWN, when pressure over 10.
- tap UP, when pressure less than 8.
- palm touch, pressure over 130. Useful for accidental touches on the touchpad while typing.
- thumb touch, not sure what does it mean.
Now start tapping on your touchpad with single finger. It will print the interactive values in terminal output. When tap DOWN/UP detected, it will display x in the corresponding columns.
2. In my case, tap lightly on touchpad results 40 ~ 50 pressure values. To make it less sensitive, I measured again by running the command below (press Ctrl+C to stop last command):
sudo libinput measure touchpad-pressure --touch-thresholds=60:10
The command tells to treat pressure value over 60 as tap DOWN, and pressure less than 10 as tap UP.
Re-run the last command again and again with different pressure values (replace “60:10“) until you found the correct thresholds for you!
And, if you want to avoid accidental touches while typing, run the command below instead (replace pressure values) to also find out correct threshold for palm touch:
sudo libinput measure touchpad-pressure --touch-thresholds=60:10 --palm-threshold=100
Step 3: Find out Device Name & DMI Modalias
After found out the correct thresholds, you also need to know the name and modalias to identify your touchpad device.
To find out touchpad name, open terminal and run command:
libinput list-devices |grep Device
As the screenshot shows, it’s Elan Touchpad in my case.
To find out dmi modalias, run command:
cat /sys/class/dmi/id/modalias
In the output, you just need to know the system vendor name (svn) and product version (pvr), while all others can be skipped by using asterisk wildcard *.
In my case, vendor name is LENOVO and product version is ThinkPadT480s. So, the dmi modalias can be described as dmi:*svnLENOVO:*:pvrThinkPadT480s*
Step 4: Add rule to configure touchpad sensitivity
Finally, run the command below to create a quirks
configuration file:
sudo nano /etc/libinput/local-overrides.quirks
NOTE: you may run sudo mkdir -p /etc/libinput
first to create the directory in case it’s not exist. And, the filename must be local-overrides.quirks
according to the libinput wiki.
When file opens, paste the lines below and change the values (text in bold) according to the last steps.
[Touchpad pressure override] MatchUdevType=touchpad MatchName=Elan Touchpad MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadT480s* AttrPressureRange=60:10 AttrPalmPressureThreshold=120 AttrThumbPressureThreshold=100
When done, press Ctrl+S to save and Ctrl+X to exit the command line text editor.
Finally, log out and back in to apply change.