Xorg Mouse Configuration

If your mouse is listed on this page you may use the corresponding configuration in order to utilize all of its buttons in X.

Logitech MX500
Logitech Marble Mouse

Logitech MX500

The Logitech MX500 is a very nice 5 button mouse, and is one of the few 5 button mice that is fully supported under FreeBSD. As root, edit xorg.conf:

vi /etc/X11/xorg.conf

Replace your mouse section with the following:

Section "InputDevice"
    Identifier "Mouse1"
    Driver "mouse"
    Option "Protocol" "Auto"
    Option "Device" "/dev/ums0"
    Option "Buttons" "7"
    Option "ZAxisMapping" "4 5"
    Option "Resolution" "800"
EndSection

In order to properly use the side buttons on the mouse, we need to setup .xmodmap. First let's become user:

exit

We need to edit configuration files for our user - not root; by typing exit we become user again.

vi ~/.xmodmap

Now add the following line:

pointer = 1 2 3 4 5 8 9 6 7 10 11

That line will remap the buttons such that the side buttons will work as expected in firefox. Finally, we need to make sure that xmodmap is run at the time we start X.

vi ~/.xinitrc

Add this as the first line of the file:

xmodmap ~/.xmodmap

Logitech Marble Mouse

For ergnomic reasons I needed to invest in a left-handed mouse. The Marble Mouse can be used left or right handed, but this configuration is for using it left handed. The large right button is left click, the large left button is right click, the small left button is middle click, and the small right button is the scroll button - if you hold in the scroll button the rolling ball becomes your scroll wheel. Now that setup is explained, we can begin to set it up. As root, edit xorg.conf:

vi /etc/X11/xorg.conf

Replace your mouse section with the following:

Section "InputDevice"
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/ums0"
    Option "Buttons" "5"
    Option "EmulateWheel" "1"
    Option "EmulateWheelButton" "9"
    Option "Resolution" "500"
EndSection

In order to properly use the side buttons on the mouse, we need to setup .xmodmap. First let's become user:

exit

We need to edit configuration files for our user - not root; by typing exit we become user again.

vi ~/.xmodmap

Now add the following line:

pointer = 3 8 1 4 5 6 7 2 9 10 11

That line will remap the buttons in order to provide proper behavior. Finally, we need to make sure that xmodmap is run at the time we start X.

vi ~/.xinitrc

Add this as the first line of the file:

xmodmap ~/.xmodmap