PDA

View Full Version : What are all the mouse buttons (Button1, Button2, etc.)?


Fyda
July 3rd, 2007, 12:18 AM
Hello! Are you confused by the names given to the mouse buttons in Compiz's settings manager? If so, this post is for you!

I have not yet tested Compiz with a two-button mouse, but X (the graphical server, which you are definitely running if you use Compiz) usually sets the mouse to be an "emulated three-button mouse". (Even real three-button mice seem to be set up this way.) This means that, if you simultaneously press Button1 and Button3, it will be interpreted as Button2.

On a standard three-button mouse, the buttons are as follows:

Button1 - Left click
Button2 - Middle click
Button3 - Right click

If the middle button is a scroll wheel, the two scroll motions also count as "buttons":

Button4 - Scroll up
Button5 - Scroll down

And, if your mouse also has a horizontal scroll wheel, or you are using a touchpad with a horizontal scroll area,

Button6 - Scroll left
Button7 - Scroll right

If you don't have any sort of input device that offers horizontal scrolling, though, Button6 and Button7 will either A) not exist, or B) do something completely different.
The above should suffice for most users. If you are using a more exotic mouse model with extra buttons, this post may be of limited usefulness to you.

Deciare
July 3rd, 2007, 12:46 AM
For more exotic mouse button configurations, you may use a program called xev to identify exactly what number each button is.

Run the command on a console:
xev
Then move your mouse cursor into the Event Tester window.

When you click or scroll, you'll see output like this in the console window where xev is running:
ButtonRelease event, serial 31, synthetic NO, window 0x2c00001,
root 0x1a5, subw 0x0, time 95986877, (50,178), root:(856,227),
state 0x1010, button 5, same_screen YES
The part on the last line that says "button 5" means that your click or scroll was interpreted as Button5.

If you have a mouse with lots of buttons, then it's likely that many of them won't trigger any response at all in xev, or trigger an incorrect or unrecognised response. To get around that, you can edit your /etc/X11/xorg.conf file to use the evdev mouse driver. For exact instructions on how to do that, please refer to your distribution's documentation. Here's a lists of links to instructions for several major Linux distributions:
Arch Linux - Get All Mouse Buttons Working (http://wiki.archlinux.org/index.php/Get_All_Mouse_Buttons_Working)
SuSE - Get all mouse buttons working (http://www.linux-gamers.net/modules/wiwimod/index.php?page=HOWTO+Mouse+Buttons)
Ubuntu - Configuring Logitech mice in Ubuntu 6.06 (http://ubuntuforums.org/showthread.php?t=219894) (may also work for later versions)
Don't see your distro up there? One of the other guides may work for you. ^^; The instructions should be pretty universal anyway, but you'll need to find out how your own distribution packages the evdev driver. Good luck!