Posts Tagged ‘Mouse reverse buttons ubuntu’

Ubuntu (debian) – Reverse your mouse buttons

May 25th, 2012

When i use a mouse with my left hand, i prefer to have the buttons reversed, for symmetry reasons.

To do this in Ubuntu/Debian you need to do the following:

First run the command:

 xinput list

xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Dell Dell USB Optical Mouse id=8 [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)] ↳ Power Button id=7 [slave keyboard (3)] ↳ BTC USB Multimedia Keyboard id=9 [slave keyboard (3)] ↳ BTC USB Multimedia Keyboard id=10 [slave keyboard (3)]

This will list your pointer devices, in my case it was a “Dell Dell USB Optical Mouse”

Now to remap your buttons, you need to figure what they are pointing to, so run

xinput --test "Dell Dell USB Optical Mouse"

Note: replace your device name with mine

Now press the buttons on your mouse, should get something like this:


button press   1 
button release 1 
button press   1 
button release 1 
button press   3 
button release 3 
button press 2
release release 2

For me that was left button = 1, right = 3 and middle = 2.

to remap button functions i then type the following:

xinput set-button-map "Dell Dell USB Optical Mouse" 3 2 1

The order of the mapping is numeric so now i have button 1 mapped to function 3 and button 3 mapped to 1 (reversed the buttons) i want 2 to remain the same.

That’s it.

if you found this helpful feel free to donate to:
ZEC: t1NQp1UuqQbmnXzazbLTSreS2AbaZpRBuTM
LTC: LZyNF1qkBUA7XFz83m5xwzGgmmj1owQn9d