Configure all mouse buttons in X

By default, in X you can only assign events to up to 7 mouse buttons; if you have a mouse with more than 7 buttons and want to get all buttons work, do the following:

  1. Use xev to determine the mouse buttons number (look for ButtonPress and/or ButtonRelease events and take note of the corresponding button number).
  2. Use xbindkeys and xvkbd to assign the button name to the event you want.

For example, to assign the button 8 to 'Alt-F4' (to close applications) write the following in ~/.bindkeysrc config file (make sure the quotes are included):

"/usr/bin/xvkbd -text "\[Alt_L]\[F4]""

  m:0x0 + b:8