For some odd reason, if you have a 5-button mouse, the 5th button (aka “forward button”) in emacs has syntax
<mouse-5> in Windows and Mac, but on Ubuntu 10.04 Linux running Gnome 2.x, it's
In unix X11, here seems to be how they assign the mouse buttons.
In emacs, you can find out the mouse button or wheel syntax by calling
describe-key then press the button.
In X11, you can call
xev to see any keyboard/mouse event and their naming.
The numbering also depends on OS and mouse driver.
For example, on Mac OS X 10.4.x, using a Microsoft 5-buttons mouse, the numbering changes depending on whether you have Microsoft's mouse driver (IntelliPoint) installed.
If you don't have IntelliPoint installed, then Mac OS X doesn't register the mouse wheel tilt left/right, and your Backward (4th) button is the same as right-button, and Forward (5th) button is 4th button.
Here's the numbering reported by emacs's “describe-key”.
<mouse-1>= left button
<mouse-2>= middle button (pressing the scroll wheel)
<mouse-3>= right button
<wheel-up>= roll scroll wheel up
<wheel-down>= roll scroll wheel down
<mouse-3>= 4th button (aka backward button)
<mouse-4>= 5th button (aka forward button)