Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu 12.04 and have a multi-button Microsoft mouse. I would like to map the CTRL and ALT modifier keys to the left and right thumb buttons of my mouse, respectively, so I can ctrl-click and alt-click without touching the keyboard. My thumb buttons are buttons 8 and 9.

I tried the solution in How do I configure a mouse thumb button? which explained how to map a double click to a thumb button - this worked for the double-click but I couldn't figure out how to modify the solution for CTRL and ALT

I also tried How to map Ctrl/Shift to thumb buttons of Mouse? which used xdotools and xbindkeys. I modified the script to this:


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

Which ALMOST works. It simulates a CTRL-key press when I click the left thumb button, but I can't actually hold the button and click at the same time - holding the thumb button seems to prevent it from listening to other input until it is released.

Does anyone know how I can make my mouse thumb button actually work as a modifier key, so I can use thumb_button+click instead of CTRL-click?

share|improve this question
Run xev | grep button\|Button, then, press the "Ctrl" tumb button over the white window, without releasing it, do a click, then release it and post the output. – Helio May 23 '15 at 14:34
@Helio see my newly created question:… – conceptdeluxe May 24 '15 at 3:42

Instead of using xdotool, if you prefer a functional GUI-based solution, you can download the Easystrokes app from the Ubuntu software center. You can easily map keyboard keys and shortcuts to mouse buttons and even mouse gestures.

share|improve this answer
I tried Easystrokes, but as far as I can tell, it won't allow me to map modifier keys to mouse buttons either. It will allow me to map a modifier+key combination, like SHIFT+A, but it won't let me map a modifier alone to a mouse button. I want holding down my mouse thumb button to have the same function as holding down the CTRL button. – rcorre Jul 13 '12 at 18:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.