Ubuntu – How to map Ctrl/Shift to thumb buttons of Mouse

hardwaremouse

I have an Microsoft Sidewinder X8 mouse and I wish to use 8 for Shift and the 9 for Control. Can anybody please tell me how?

Best Answer

Install xdotool and xbindkeys

sudo apt-get install xdotools xbindkeys

Then copy the following code into ~/.xbindkeysrc

"xdotool keydown shift"
        b:9
"xdotool keyup shift"
        release + shift + b:9
"xdotool keydown ctrl"
        b:8
"xdotool keyup ctrl"
        release + control + b:8

where b:x is the number of your button which you can find out using xev. As I don't want this bindig permanent everytime I need it I start a terminal and type xbindkeys -n. When I don't need it anymore I simply close the terminal.