SDB:Mousebuttons

From openSUSE


Version: 10.2 10.3

Contents

Situation

You have a mouse with more then 3 buttons and you want to use them for navigating in your web browser (e.g. use them as back and forward buttons). Note, as of Firefox 3 Beta 4, this behavior has changed and this procedure does not work anymore.

Procedure

To configure the mouse, open the xorg.conf file in a text editor. For example: vi /etc/X11/xorg.conf

Then, search for the section that starts with:

 Section "InputDevice"
   Driver       "mouse"

We need to edit the option ZAxisMapping here. The exact values vary per mouse model you have. The next section will list the values per mouse model

Trust GM-4200 Predator

Change the section so that it looks like this:

 Section "InputDevice"
   Driver       "mouse"
   Identifier   "Mouse[1]"
   Option       "Buttons" "8"
   Option       "Device" "/dev/input/mice"
   Option       "Name" "Trust GM-4200 Gamer Optical Mouse"
   Option       "Protocol" "explorerps/2"
   Option       "Vendor" "Sysp"
   Option       "ZAxisMapping" "6 7"
 EndSection

Save your changes and restart your X server.

Next we need to tell X to start using the updated configuration. You can do this by running the xmodmap command. For the GM-4200 the xmodmap command looks like this:

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

Logitech MX-310

Change the section so that it looks like this:

 Section "InputDevice"
     Identifier     "Mouse[1]"
     Driver         "mouse"
     Option         "Buttons" "7"
     Option         "Device" "/dev/input/mice"
     Option         "InputFashion" "Mouse"
     Option         "Name" "Logitech;MX310"
     Option         "Protocol" "explorerps/2"
     Option         "Vendor" "Sysp"
     Option         "ZAxisMapping" "4 5"
     Option         "ButtonMapping" "1 2 3 6 7"
 EndSection

Restart the X server and you're ready to go. You don't need to carry out the next steps for using the xmodmap command.

Belkin USB Mouse

You can use the same configuration as for Logitech MX-310. This configuration is also known to work with the "Typhoon Optical Office Mouse 40809"

A version for the"Belkin F8E850-opt Optical Mouse" (5 buttons plus wheel up|down):

Section "InputDevice"
 Driver       "mouse"
 Identifier   "Mouse[1]"
       Option  "Device" "/dev/input/mice"
       Option  "Protocol" "Auto"
       Option  "Buttons" "7"
       Option  "ZAxisMapping" "4 5"
       Option  "ButtonMapping" "1 2 3 6 7" 
       Option  "Emulate3Buttons" "off"
EndSection

The effect, as with the others, is to provide the side buttons with functions the same as the forward and backward buttons on the Firefox browser. In other applications, the side buttons will now function as an access to the same function as the horizontal sliding bar to reorient a window view pane|port left or right. The latter can be modified if desired. As expected, the wheel will continue to be able to scroll the active window view pane|port up or down(same function as the vertical sliding bar).

Automatically applying the changes on startup

In the way we've setup the X configuration now, the xmodmap command would have to be started manually at every login. In order to do this automatically you can do the following:

Using KDE

Create a new file in /home/<username>/.kde/Autostart (e.g. mousebuttons.sh). In this file, copy paste the xmodmap line for your mouse model. Save and close the file. Make it executatble by running the command:

 chmod +x ~/.kde/Autostart/mousebuttons.sh

That's it. From now on you can use the mouse buttons on the left side of your mouse to navigate back and forth in Firefox.