Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 use emacs on several machines between work and home, and I'm naturally interested in remapping that Caps_Lock key to save my finger from agony. On some platforms it's a bit more difficult to do than one would like, the interface to the X server is far from being user-friendly.

On the other hand, I managed to set up a simple system to share my emacs configuration across machines. Since the remapping of the key is mainly useful inside emacs, is there a way to remap CapsLock to Control (and vice-versa) inside emacs only?

If it makes any difference, I use emacs 24.1.

share|improve this question
It may not be possible, or if possible, trivial, at least according to Moving The Ctrl Key page of the Emacs wiki. – Pedro Romano Oct 31 '12 at 18:19
The OS (more precisely X) treats CapsLock and Ctrl specially, so you can't. You need to do it at the level of the X server. (Ok, strictly speaking you can, but it'll play hell with the CapsLock functionality unless you deactivate that on the X server, and I don't think Emacs has any code to do it.) – Gilles Oct 31 '12 at 22:08

Your Answer


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

Browse other questions tagged or ask your own question.