TECH

Logitech multibutton mouse configuration – easy guide

I have Logitech mouse for some time now. I finally decided to make the thumb buttons (Prev/Next) work. It wasn’t obvious, so I feel like describing it for the sake of others.

Steps to configure multibutton mouse

I’ll describe the whole process, not just the MX900 solution, so you can use it for other multibutton mice.

Step: 1

First step is getting to know which button events do your mouse buttons generate. Edit /etc/X11/xorg.conf and comment-out every special option you might have and set the protocol to “ExplorerPS/2″ (this protocol supports many mouse buttons).

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "ExplorerPS/2"
#Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "false"
Option "CorePointer"
Option "Resolution" "800"
EndSection

Restart X server now. (Ctrl-Alt-Backspace) After starting it again launch terminal window, and run “xev” in it (X Event Viewer). When the xev window appears move your mouse over it, and press your mouse buttons one after another.

Step: 2

The story splits here, depending on X.org version you have.

Mouse buttons on my MX900 gave me button events: 1 2 3 x x 4 5 x. Where x means that pressing the wheel-up, wheel-down and menu buttons didn’t give any response.

OK. Next step is to map the wheel events to mouse buttons. We see that we have buttons from 6th up free. So let’s map wheel to mouse buttons 6 and 7, and tell X that we have 7 buttons on the mouse.

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "6 7"
Option "Buttons" "7"
Option "Emulate3Buttons" "false"
Option "CorePointer"
Option "Resolution" "800"
EndSection

Mouse buttons on my MX900 gave me button events: 1 2 3 4 5 8 9 x. OK. Every button gives an event (except the menu button, but I just ignore it). Nothing to be done here more.

Step: 3

Step three is remapping the button events.

Applications expect the following mouse button mapping: LeftMouseButton, MiddleMouseButton, RightMouseButton, WheelUp, WheelDown, Back, Next… We need to use xmodmap to remap our mouse events in the correct order. That’s preety easy actually.

xmodmap -e "pointer = 1 2 3 6 7 4 5"

xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7 10 11"

(I didn’t put Option "Buttons" "7" in xorg.conf for X.org 7, so xmodmap wanted all 11 buttons, so I gave them to it.)

Step: 4

One last thing – How to make it permanent?
Just put the xmodmap line to ~/.xprofile and restart X.