mikelindner.com

powering the Internet since 1995

| Photography | Computing | Cooking |

Disable middle click on Synaptics touchpads

January 7th, 2022

I’ve just moved back to a Linux laptop, specifically Arch Linux, using XFCE4 on an HP Dragonfly Elite, after a few years trying Mac. Totally love it, the full Linux experience without trying to be MacOS.

One thing that did annoy me was the touchpad was set to have three “buttons” or click areas along the bottom. This meant if I went to choose a browser tab, sometimes I’d miss the left edge button and hit the middle button closing the tab. Annoying.

These are the steps I used to set it to be one longer Left button with no right button.

~ 🐠  yay -S xorg-xinput
~ 🐠  xinput
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Wacom HID 4924 Finger                   	id=13	[slave  pointer  (2)]
⎜   ↳ SYNA30A1:00 06CB:CD74 Mouse             	id=14	[slave  pointer  (2)]
⎜   ↳ SYNA30A1:00 06CB:CD74 Touchpad          	id=15	[slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad              	id=19	[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)]
    ↳ Power Button                            	id=8	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=9	[slave  keyboard (3)]
    ↳ HP HD Camera: HP HD Camera              	id=10	[slave  keyboard (3)]
    ↳ HP HD Camera: HP IR Camera              	id=11	[slave  keyboard (3)]
    ↳ Wacom HID 4924 Pen                      	id=12	[slave  keyboard (3)]
    ↳ Intel HID events                        	id=16	[slave  keyboard (3)]
    ↳ Intel HID 5 button array                	id=17	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=18	[slave  keyboard (3)]
    ↳ HP WMI hotkeys                          	id=20	[slave  keyboard (3)]
    ↳ HP Wireless hotkeys                     	id=21	[slave  keyboard (3)]
    ↳ HP Active Pen G3 Keyboard               	id=22	[slave  keyboard (3)]

Now I can see the name of my touchpad “SYNA30A1:00 06CB:CD74 Touchpad”.

Next command will show the existing button map, which returns the map, currently “1 2 3 4 5 6 7”. Not quite sure what 4-7 does though!

~ 🐠  xinput get-button-map 'SYNA30A1:00 06CB:CD74 Touchpad'
1 2 3 4 5 6 7

And now I can see my annoying “button 2”. To test the change this command does it temporarily:

~ 🐠  xinput set-button-map 'SYNA30A1:00 06CB:CD74 Touchpad' 1 1 3 4 5 6 7 
~ 🐠  xinput get-button-map 'SYNA30A1:00 06CB:CD74 Touchpad'
1 1 3 4 5 6 7

Now I have button 1 set in 2 slots, button 3 in the third slot and no button 2.

To make it permanent add the following to /etc/X11/xorg.conf.d/30-touchpad.conf

Section "InputClass"
	Identifier "SYNA30A1:00 06CB:CD74 Touchpad"
	Option  "ButtonMapping" "1 1 3 4 5 6 7"
EndSection

And now it sticks after rebooting! Sweet! 😎