Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an older version of RHEL. In newer versions, there is usually an option to map the caps key to the esc key. How would I do this in an old version?

Going to System Preferences -> Keyboard -> Layout Options -> CapsLock Key behavior doesn't have the option to switch caps lock key to escape key.

share|improve this question

1 Answer 1

Add the following to your ~/.Xmodmap file:

keycode 66 = Escape NoSymbol Escape
clear Lock

See Remapping Caps Lock with xmodmap doesn't work for explanations.

Run xmodmap - <~/.Xmodmap to apply your changes immediately. They will be applied automatically when you log in in the future.

(By the way, this is essentially what's going on under the hood in RHEL 6, which is apparently where you got the desire for this feature in RHEL 5. This is what I meant by my deleted comment that this stuff had been nailed down years before. All they've done is put a little GUI glaze on top of an ancient mechanism.)

share|improve this answer
    
You also need to remove the Lock modifier. And there's no need to restart the X session. –  Gilles Jun 23 '12 at 0:32
    
I considered adding the xmodmap(1) stuff, but didn't feel the need to complicate things. The setting needs to be persistent eventually, and it's not like you're going to be changing it that often. –  Warren Young Jun 23 '12 at 1:04

Your Answer

 
discard

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.