I now hove a working 7 button mouse. It is a standard USB Microsoft
Intellimouse Explorer. It has two normal buttons, a scroll wheel which
counts as three buttons (middle, up and down) and two buttons along the side
which, under windows, are used as the back and forward keys when web
browsing.
Here are my instructions for making your 7 button mouse work. My situation
was complicated by having a second mouse attached which X thought was my
primary mouse. Without that complication, this would have been pretty easy.
More on this below.
First, to make X understand my mouse you need these lines in your mouse's
InputDevice section of your /etc/X11/XF86Config file:
Option "Buttons" "7"
Option "ZAxisMapping" "6 7"
This lets the X server know that you have 7 buttons. Unfortunately, no
application seems to ask the X server which buttons are the scroll buttons,
they just assume that buttons 4 and 5 are the ones you use, and now you are
using 6 and 7. At this point let me point out that I had to put the Buttons
7 line in both mouse descriptions. It is probably only necessary in my
primary mouse, but it works if it is in both even though my other mouse has
only 2 buttons.
Now restart the X server. If you use xdm/gdm/kdm, be sure to really restart
the server, not just log out and log back in. If you forget to do this you
will get very annoyed that your config changes have had no affect. Take it
from me, this is easy to do.
So now you need to remap the buttons. Use xmodmap for this. The comand is
xmodmap -e "pointer = 1 2 3 6 7 4 5"
which remaps buttons 6 and 7 to buttons 4 and 5. You can test this by running
xev from a shell window. xev will put up a little window. Place your mouse
in that window and click away. You will get lots of information about the
clicks in the shell window. Check for the button numbers.
Now you should have a working 7 button mouse, but the two side buttons don't
do anything useful. Time for imwheel. Find and install imwheel. It doesn't
seem to be supplied for RH, but I had no trouble grabbing a random RPM off of
rpmfind.net and installing it.
Edit .imwheelrc in your home directory and put in the following lines:
".*"
None, Up, Alt_L|Left
None, Down, Alt_L|Right
Finally, run imwheel like this: imwheel -k -b "67"
The end result is that the two extra buttons now send Alt-Left arrow,
Alt-Right-arrow which most browsers can interpret as back and forward.
Once this is all working for you you should make it happen automatically. If
you use KDE, you can put a script in .kde/Autostart and it will get run on
start-up. I'm not sure how GNOME startup works. If you don't use these, you
probably have either .xinitrc or .Xclients which runs early in your X
startup.
If, like me, you have 2 mice you need to be careful. AFAICT, xmodmap can only
affect the first mouse. Since my USB mouse was my second mouse, xmodmap was
not able to remap the buttons. I had to switch things around in my
XF86Config file so that my usb mouse was my first mouse. After that, I had
no trouble.
Hope this helps someone.
--
MichaelHirsch - 17 Feb 2004