My solution to disable middle click
All,
Relatively inexperienced linux user here. I recently installed arch on my Acer SF315-51G-51CE after using Manjaro on it for a while, and one odd behavior I noticed when I had everything installed was that my touchpad now had a middle click where it did not before, and I found myself constantly deleting tabs in my browser or pasting things without meaning to.
When looking for ways to disable it, I came across this helpful thread:https://unix.stackexchange.com/questions/438725/disabling-middle-click-on-bottom-of-a-clickpad-touchpad
I found that xinput list gave an output of:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SYNA7DB5:00 06CB:7DB7 Mouse id=10 [slave pointer (2)]
⎜ ↳ SYNA7DB5:00 06CB:7DB7 Touchpad id=11 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Video Bus 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)]
↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)]
↳ Acer WMI hotkeys id=13 [slave keyboard (3)]
Then, xinput get-button-map 'SYNA7DB5:00 06CB:7DB7 Touchpad' gave the output:
1 2 3 4 5 6 7
I found that xinput set-button-map 11 1 1 3 4 5 6 7 (the 11 at the start refers to the id number o the touchpad) caused the middle click to be disabled and replaced with more left click area (the mapping of the numbers seems to vary slightly with the model of trackpad, with some having middle mapped to 2, others 3, so this may take some trial and error).
However, I found that this change was not preserved on reboot, so after some more research I went into /etc/profile.d and created a new file called "touchpadmod.sh" (but you can name it whatever you want and it will work) and added the line xinput set-button-map 11 1 1 3 4 5 6 7 inside it. Now this change is run on every reboot and seems to work from what I can tell.
I don't know if this is the best solution, but I figured I would document my findings. If anyone knows of a more elegant solution to this, I would be curious to hear about it. I did not see any options related to this in the system settings for the touchpad (my DE is KDE if that matters). I am also curious why I never observed this in Manjaro, but then suddenly started seeing it after installing Arch.
EDIT (5/30/2023): Upon doing more research, I found that the above solution with a profile.d script was slightly glitchy and would sometimes revert itself upon coming out of hibernation or some other unknown factor. I believe this may be something to do with Wayland and libinput versus xorg and xinput in KDE, and possibly due to the fact that Manjaro uses gnome-tweaks, which I do not use in my Arch install. A better, and I think more elegant solution I found to make this change persistent on reboot was to edit /usr/share/X11/xorg.conf.d/40-libinput.conf and in the "libinput touchpad catchall," I added in the line Option "ButtonMapping" "1 1 3 4 5 6 7" at the end of the section, e.g.:
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "ButtonMapping" "1 1 3 4 5 6 7"
EndSection
I have now tested this solution to work with both the Synaptics touchpad on my Acer laptop as well as the Elan touchpad on a Gigabyte Aero 15-W8 laptop.
Posted May 13, 2023, 1:18 AM UTC · edited
Just wanted to drop a huge thanks for this solution - can confirm it works as written on Thinkpads T470, T560 and T470s.
Glad to hear!