I have a Logitech MX-510, that I've been using for about six years.

The Mouse has several extra buttons, that I'd like to use in Gnome, but I have problems with the button codes, that the mouse sends to the driver:
Button 1 (mouse wheel button) works as expected. One
ButtonPressevent withstate 0x10andbutton 1on press, andButtonReleasewithstate 0x110on release.Button 2 (mouse wheel button) works as expected. One
ButtonPressevent withstate 0x10andbutton 2on press, andButtonReleasewithstate 0x210on release.Button 3 (right button) works as expected. One
ButtonPressevent withstate 0x10andbutton 3on press, andButtonReleasewithstate 0x410on release.Button 4 (scroll up) works as expected. It sends a
ButtonPressevent withstate 0x10andbutton 4, and aButtonReleaseevent withstate 0x810. Both events occur instantaneous on each scroll step.Button 5 (scroll down) works as expected. It sends a
ButtonPressevent withstate 0x10andbutton 5, and aButtonReleaseevent withstate 0x1010. Both events occur instantaneous on each scroll step.
Buttons 6 and 7 seem to not exist.
Button 8 (back button) works as expected. It sends a
ButtonPressevent withstate 0x10andbutton 8, and aButtonReleaseevent also withstate 0x10. Both events occur instantaneous on each scroll step.Button 9 (back button) works as expected. It sends a
ButtonPressevent withstate 0x10andbutton 9, and aButtonReleaseevent also withstate 0x10. Both events occur instantaneous on each scroll step.
The mouse has three additional buttons, as you can see in the picture above.
Button 10 (on the very top of the mouse) is not usable. It sends a
ButtonPressevent withstate 0x10andbutton 10, and aButtonReleaseevent also withstate 0x10. The button is not usable with Gnome, because it is not selectable. Most option selectors, like that one of CompizConfig Settings Manager just goes up to Button 9.Button 11 (extra button to the front of the mouse wheel) is not quite usable. When pressed, it sends a
ButtonPressevent withstate 0x10andbutton 11, and anotherButtonPressevent withstate 0x10andbutton 4and yet another oneButtonPressevent withstate 0x810andbutton 4(the last two being the same behaviour as if the scroll wheel was moved one step up). On release it sends aButtonReleaseevent withstate 0x10andbutton 11. But the catch is, when the button is held down, it repeats the "mouse wheel simulation" about five times per second. (like a mousewheel cruise-control or something).Button 12 (extra button to the back of the mouse wheel) is not quite usable. When pressed, it sends a
ButtonPressevent withstate 0x10andbutton 12, and anotherButtonPressevent withstate 0x10andbutton 5and yet another oneButtonPressevent withstate 0x1010andbutton 5(the last two being the same behaviour as if the scroll wheel was moved one step up). On release it sends aButtonReleaseevent withstate 0x10andbutton 12. When held down it displays the same cruise-control behavior as button 11, but with the respective button and state parameters.
Is there a way how I can remap those additional keys in a way, where I can use them or make them usable with Gnome? And especially, if it is possible, to make buttons 11 and 12 stop sending codes for mouse wheel scroll up and down. And if possible, how can I change the general behavior of the mouse buttons in general?