Sunday, January 4, 2009

Map CAPS-LOCK to Control in Ubuntu and Mac OS X.

I dislike CAPS-LOCK. It is a key that has not made much sense to me since the Commodore 64. It's one of those odd legacy keys from lord knows when in antiquity. One of the most annoying things about CAPS-LOCK is that it has great placement on the keyboard.

One of the most useful keys for a *NIX geek is Control. It's the all purpose key on the command line.

So if you're into Linux or FreeBSD or anything in between, mapping CAPS-LOCK to Control can really speed you up and save your wrists a lot of strain. Your pinky can now reach Control without having to do that funny pivot down and left or right.

If you just dislike the CAPS-LOCK key, as in it gets in your way while you're trying to type, this is also a good option to 86 it as well.

535301472 63095Fa448 O
One option you have is to buy a keyboard where CAPS-LOCK is already replaced by a hardware-mapped Control key, like the Happy Hacking series of keyboards (my personal favorite keyboard, just barely inches out the Model-M for best keyboard ever).

So here are two ways to map CAPS-LOCK to Control. One in Ubuntu Linux (7.10 and up) and one in Mac OS X.

Ubuntu Linux with Gnome


  1. Click on System -> Preferences -> Keyboard
  2. Click on the Layouts tab
  3. Click on Layout Options...

    Screenshot-3
  4. Expand Ctrl key position
  5. Select the Make CapsLock an additional Ctrl. radio button.

    Screenshot-2-1
  6. Close, boom done!


Apple Mac OS X 10.5


  1. Click on Apple -> System Preferences
  2. Go to Keyboard & Mouse
  3. Click on Modifier Keys

    Picture 1-20
  4. Select the Caps-Lock Key pulldown

    Picture 2-7
  5. Set it to Control

    Picture 3-7
  6. Boom! Done.


And then if you're a total obsessive like I am, you can do this sort of thing...

Model M Control

A neat feature of FreeBSD 5; it gives you the option to map CAPS-LOCK globally to Control during the install process.

Unrelated Side Note:

THIS was so cool it actually made me a little angry.
  • C64 USB keyboard
  • 3 comments:

    1. [...] Reply · View ubuntutweets: RT: : Map CAPS-LOCK to Control in Ubuntu and Mac OS X. http://www.devlab.ca/blog/?p=4188 http://tinyurl.com/7vsne9 2009-01-04 18:41:30 · Reply · View tpurd: Mac nerding [...]

      ReplyDelete
    2. Not exactly sure how I stumbled upon this but excellent point about the caps lock! I do use it from time to time but I think I'll give it a try as something else and see if it proves to be more useful! Thanks for the how-to!

      cheers

      ReplyDelete
    3. I have xmodmap to do this in ubuntu and puppy linux, but when it came to mac os, couldn't figure out how to do it (even though I went to the keyboard settings, I failed noticed this button). I now have caps lock working as control and am back to business in vim. Thank you.

      ReplyDelete