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

Since I rarely use caps-lock, I'd like to map the key to a middle mouse click instead. I would also like to map Alt+Caps Lock to the original function of the caps lock key, should I ever need it.

I can map any keyboard shortcut to xdotool click 2, but the Gnome Keyboard Shortcuts dialog won't let me assign a command to the caps-lock key, even with modifiers.

I know this is a bit of a strange undertaking; How would I go about doing it?

share|improve this question
up vote 2 down vote accepted

If you first remove the lock modifier from the Caps Lock key you should then be able to assign the key in Keyboard Shortcuts, use the command below to do that:

echo  'remove lock = Caps_Lock' | xmodmap -
share|improve this answer
very good! any chance to get caps lock back onto alt+capslock? – Stefano Palazzo Dec 18 '10 at 16:36

Another easy solution if you prefer to use a GUI is to download easystrokesInstall easystrokes app from the Ubuntu software center. You can easily map keyboard keys and shortcuts to mouse buttons as well as mouse gestures.

share|improve this answer

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.