switch control and caps lock

Sun keyboards have a few differences from normal 101-key keyboards. One is that the locations of the left Control and Caps Lock keys are switched. If you use the Control key often, this makes a big difference, ergonomically. Here’s how to switch the left Control and Caps Lock keys on normal keyboards, on any *nix platform that runs X Windows.

Add these two lines to ~/.Xmodmap:

! Switch caps lock and (left) control
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L

Now load the changes into X:

$ xmodmap ~/.Xmodmap

Voila! You’re now one step closer to Sun keyboard bliss.

3 thoughts on “switch control and caps lock

  1. I would like to switch the left caps lock and control keys on my standard PC keyboard but have no idea if your page on that subject applies to my Windows XP Professional system, or how to access the location in my operating system to do that. Could you provide more context for a nonprogrammer attempting this procedure? Thanks!

  2. thats probably how he got here in the first place, smartass..

    anyway, try here:
    http://johnhaller.com/jh/useful_stuff/disable_caps_lock/ and grab the registry file called “swap_caps_lock_and_control.reg”.  Double click it to install it, log out and log back in, and you should be good to go. 

    If that link doesnt work, try some other results off of google until you find a page with a registry script that looks like it does what you want.

Leave a Reply

Your email address will not be published. Required fields are marked *