Palm Rejection in Trackpads
I’ve recently dug out my old X1 Carbon laptop and started tweaking it to make it more usable, beginning by replacing the battery and improving the power settings in software. I finally decided to address another annoyance: stray mouse clicks while trying to type, causing my cursor to jump and my typing to land in the wrong place.
Happy to report that fixing this issue was as simple as running
sudo apt remove xserver-xorg-input-synaptics. But wanted to write down why this worked.
Basically, all laptop touchpads/trackpads get in the way of typing because your palms will naturally brush across the trackpad surface. You can imagine this would be especially problematic on Macbooks because they have a huge trackpad!
What I didn’t realize (but in retrospect seems obvious) is that your trackpad drivers come with palm-rejection software, which prevents your palm from triggering stray clicks. Part of why I never noticed is that Apple has their shit figured out and I’ve never had any issues with their wonderful trackpad. And I chalked up my poor typing experience on the X1 Carbon to buggy hardware without thinking too deeply about it until now.
Synaptics is the company that provides trackpads to a lot of laptop manufacturers, and their driver has a bunch of settings you can tweak.
You can find your touchpad on Linux using
> xinput ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)] ⎜ ↳ TPPS/2 Elan TrackPoint id=12 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Integrated Camera: Integrated C id=9 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)] ↳ ThinkPad Extra Buttons id=13 [slave keyboard (3)]
Then you can use xinput to update palm-detection settings, like this:
xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Palm Dimensions" 32 4 100
I explored a variety of settings to get my touchpad to behave, and was able to improve it. But it would still, annoyingly, intermittently, allow stray palm clicks to get through.
Finally I read somewhere that someone just removed the synaptics driver altogether, which causes default
libinput to be used instead. And turns out
this works great. The “advanced features” of synaptics touchpads turn out to be totally unnecessary and in fact worse altogether than using the default
driver. Mystery solved.