Remapping Mouse Buttons on Linux Mint

This worked for me on Linux Mint 19.

First, install “xbindkeys” and “xautomation” with :

$ sudo install xbindkeys
$ sudo install xautomation

Then see which mouse button to remap by running "xev | grep button" and press the button you want to remap in the xev window. For me, it was button '8'.

The above comes from https://www.howtoforge.com/tutorial/map-mouse-on-linux/, but that article references /etc/X11/xorg.conf which I had trouble making.

So I found https://forums.linuxmint.com/viewtopic.php?t=241162 which suggested the following :

$ xinput => Tells me mouse is id=10

$ xinput get-button-map 10 (10 is id=10 = mouse)
1 2 3 4 5 6 7 8 9 10 => My mouse has 10 logical buttons

Now from button pushing in xev, I knew I wanted to remap button 8 to match button 3 so :

$ xinput set-button-map 10 1 2 3 4 5 6 7 3 9 10

Note the first '10' is the mouse id of 10. The next 10 numbers are the button assignments. Note they're unchanged from get-button-map except '8' was replaced with '3'.

Categories: