Mapping Mouse buttons to Commands

New mice often have lots of buttons. Some buttons are used by X and some are used by Applications:

  • 1,2,3: Left, middle and right mouse button
  • 4,5: Y axis mouse wheel
  • 6,7: X axis mouse wheel
  • 8,9: Foward and backward in browsers usually

But other buttons are not mapped to any function mostly.

My Mad Catz R.A.T.5 mouse has an additional wheel which sends button event 10,11. I mapped this to volume up and down using xbindkeys.

If you like this functions add this to ~/.xbindkeysrc:

"aumix -v +1"
 m:0x0 + b:10 (mouse)
"aumix -v -1"
 m:0x0 + b:11 (mouse)

and start xbindkey on X11 session start. I use a line in ~/.xsession for this.