This is kind of driving me crazy. I don’t mind having a middle mouse button, and while other people might disagree, to me it seems so wrong to have a middle touchpad “button”. Especially when 1) it’s super easy to accidentally “push” it, and 2) it does all sorts of destructive things like closing tabs in Firefox.
I’ve disabled the “middle click paste” in the gnome tweak tool, but that doesn’t seem to have fixed anything. The terminal still gets middle touchpad clicks, Firefox still gets middle touchpad clicks (and I’ve accidentally closed my gmail tab 3 times this morning), and when I check libinput debug-events, I’m still seeing BTN-MIDDLE.
How do I just comprehensively kill this thing dead? Do I have to recompile libinput? How is this supposed to work?
Hi @tedmiddleton, welcome to the community! Please take a minute to go through the introductory post in the #start-here category if you’ve not had a chance to do so yet. It includes information on how to use the forum effectively.
xmodmap is how I would have done this remapping in the xorg days, but with wayland, I don’t think xmodmap does very much - I would imagine that it would work for X-based programs like Chrome, but what about Firefox, and all the Gtk and Qt applications?
… and it looks like it reacts to a touchpad setting “middle-click-emulation” - I’m assuming that this is under /org/gnome/desktop/peripherals/touchpad in dconf? But when I set /org/gnome/desktop/peripherals/touchpad/middle-click-emulation to true … nothing happens! Ack!
I wonder whether that change ever got merged into master in mutter?
Well, I don’t know what middle-click-emulation does, but click-method=‘fingers’ seems to work ok - ideally I’d be able to left click with an area while turning off middle click altogether, but that doesn’t seem possible; with click-method=‘fingers’, at least I won’t be zapping firefox windows closed all the time. And I can adapt - my thinkpad has dedicated touchpad buttons too anyways.
The idea is that if you had a mouse without a middle button, you could still send middle click events, by clicking the left and right buttons simultaneously.
You can also find these settings in GNOME Tweaks, under “Keyboard & Mouse”. I can’t test this right now, but like you said, might be worth trying to log out and back in (or a reboot?). I don’t know if it’s something that can be changed on the fly or only during device enumeration. I have used the “fingers” setting and it works as expected, it’s difficult to accidentally do a three-finger tap.
Yeah - middle-click-emulation doesn’t seem to do anything and it doesn’t exist in gnome-tweak-tool, but click-method works. It would have been ideal to still have click-method="area" and just kill the middle button somehow, but click-method="fingers" is ok too I guess. And it’s a lot less troublesome than patching and recompiling libinput.
Thanks, @alexpl, @rele . I think this is a pretty decent solution.