Super User is a question and answer site for computer enthusiasts and power users. 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 was able to remap CTRL and CAPS LOCK keys with each other using registry editor in Windows. It is pretty convenient now in emacs but quite awkward for the normal applications.

I'd like to remap CTRL <-> CAPS only for emacs but for everything else, the keys should remain the same. Is it possible?

share|improve this question

Yes, it's possible with an AutoHotkey script like the following:

SetTitleMatchMode, 2

#IfWinActive, Emacs
Capslock::Ctrl
Ctrl::Capslock
#IfWinActive

See SetTitleMatchMode, #IfWinActive / #IfWinExist, Remapping Keys and Buttons and other AHK docs if you need to tweak the script (especially to match the Emacs window title or ahk_class properly).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .