Linux: X11 Mouse Button Numbering
In Linux X11, each mouse button is assigned a number.
Here's the numbering:
- 1 = left button
- 2 = middle button (pressing the scroll wheel)
- 3 = right button
- 4 = turn scroll wheel up
- 5 = turn scroll wheel down
- 6 = push scroll wheel left
- 7 = push scroll wheel right
- 8 = 4th button (aka browser backward button)
- 9 = 5th button (aka browser forward button)
[see Linux: How to Swap Mouse Buttons]
How to find the X11 mouse button number?
xev in terminal, then click the button to see its number.
xev, just close its window.
Mouse Numbering on Windows and Mac
The numbering also depends on Operating System 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.
X11 mouse Numbering Scheme on Mac OS X with Microsoft 5-buttons Mouse without IntelliPoint Software
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
<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
- none = push/tilt scroll wheel left (some mouse only)
- none = push/tilt scroll wheel right (some mouse only)
<mouse-3>= 4th button (aka backward button)
<mouse-4>= 5th button (aka forward button)
See also: Mouse Reviews