Monday 26 August 2019

Swapping mouse buttons in Linux

Since I occasionally change the mouse from right hand to left hand and vice versa (for ergonomic reasons) I like to swap the buttons as well so that primary button is always used by my index finger and secondary with middle finger. And I always forget how to do this.

To get the device ids:

xinput --list

Find the device id for the mouse and then to change button mapping:

xinput --set-button-map [id] 3 2 1

Manjaro's GUI for this does not seem to work for me. I think it assumes there can be no more than one device identified as mouse so it won't let me change from right-handed to left-handed for the second device. This keyboard is identified as a pointing device as well for some reason and has lower id than the mouse.

No comments:

Post a Comment