Metacity lets you bind keystrokes to all sorts of things, but it doesn’t let you bind all those extra buttons on your mouse to anything at all. I don’t have a particularly flashy mouse, and it has the usual left and right buttons, plus a scroll wheel (i.e. up and down buttons) which doubles as a middle button, and can be pushed left and right as well, plus two shoulder buttons and a two-way zoom control. That’s eleven buttons. GNOME bug 374601 asks for them to be bindable in the same way keystrokes are bindable.
The patch added this evening lets you bind these as Buttonn, e.g. Button5, possibly including some modifiers such as <Alt>. Which button Button5 is is unfortunately down to you to find out; you can discover the answer using
xev|grep -A2 ButtonPress
and clicking in the resulting window with each button in turn.
Feedback on the patch is very welcome; I’m not certain the use of a flag bit rather than a separate flag was wise, and I don’t know whether it was worthwhile to forbid the user to bind the left, middle, and right buttons and the scrollwheel on the grounds that they’re commonly used by applications. I mean, perhaps you want <Alt>Middle to do something and you don’t really care that it’s taking a possible button press away from your apps.
Try the patch out and see whether it works for you. I’m trying it myself at the moment with the various extra buttons bound to switch_to_workspace_n and it’s proving its worth already.
Photo © Thristian, cc-by-sa.