The Caps Lock key on most PC keyboards is in the position where the Control key is on many other keyboards, and vice versa. This can make it difficult for programmers to use the "wrong" kind of keyboard.

One really stupid thing about PeeCee keyboards is that manufacturers even realized that putting caps-lock on home row was a bad idea because people kept hitting it with the 'a' key. Did they move it? No, that would be too sensible. They carved a little piece of it off to leave a bigger gap. So now if I re-map a standard PC-10* keyboard so that left-control is in a sensible place, it is still harder to use than it should be. :(

Many people (the majority, clearly) feel that the placement of CTRL below the SHIFT key is a better location for it. However, the backspace key is way out of the way -- it would be better if the CAPSLOCK and backspace keys were swapped.

Unix, Console

If you have loadkeys (as you would under Linux), this should do the trick:

loadkeys /usr/share/keymaps/i386/qwerty/emacs2.kmap.gz

To reset to the defaults (you may have to switch to another tty and back to undo ctrl-lock):

loadkeys -d

Unix, KDE

For KDE 4, you can use the GUI. Go to System Settings -> Input Devices. On the left, select Keyboard. Select the third tab "Advanced". Select "Configure keyboard options". Expand the option "Caps Lock key behavior" and check "Make CapsLock an additional ESC".

Unix, X

Under Redhat 8.0, just enable the following line in /etc/X11/XF86Config

Option "XkbOptions" "ctrl:swapcaps"

Replace "swapcaps" with "nocaps" to turn both keys into "Control."

With X, there are at least 2 different ways to remap the keys. One is using xmodmap. For example, man xmodmap shows how to swap the left control key and the CapsLock key:

Many people don't want a CapsLock key at all. They can change the CapsLock key to a ControlKey? by using the following lines in xmodmap:

clear Lock
keycode 0x7e = Control_R
add Control = Control_R

Maybe you have to change the keycode 0x7e. You can find the keycodes with xev. I Furthermore, this only works if you don't have a right control key. I hope somebody has a solution which does not have this restriction.

This solution might be the easiest one. If you do not have a problem owning a dead key in your keyboard you might disable CapsLock at all:

"remove lock = Caps_Lock" (or just: "clear lock")

A better solution might be this sequence, which is keycode independent and does not remove
existing control keys:

Apple now allows switching the mapping of any modifier keys in the Keyboard section of the Keyboard & Mouse preference panel. Simply go there and click the Modifier Keys button to change the mapping (Apple specifically mentions this feature is for developers who use Control often; score another one for us programmers!)

Almost a year ago, I e-mailed Microsoft support and asked them how to do this in 2k. They sent me a Microsoft utility that can remap the keyboard, twiddling registry bits in the background, which seems a cleaner solution than ctrl2caps. Unfortunately, I can't remember the name of the app, and I no longer have the e-mail. -- RobertChurch

Once you get sick of fiddling around with arcane configuration files in various operating systems (or using utilities that do the same), you can always buy a keyboard with control where caps usually is: http://www.pfuca.com/products/hhkb/hhkbindex.html

I bought a HappyHackingKeyboard? (http://shop.store.yahoo.com/pfuca-store/), but I'm not happy with it. There's a bunch of empty space in the bottom corners which could have been used to expand the painfully-small Alt keys. I also have weird mapping problems if I boot windows, since it has a different interpretation of the Alt/Meta keys than X. I much prefer a regular keyboard with nicely shaped keys (esp. ThinkPad) and a mercilessly customized xmodmap. -- LukeGorrie
See also: CapsLockOff
The cubicle police and their lackeys would forbid this and crack your knuckles for being a CompulsiveCustomizer.
Keep in mind, it's infuriating to use some else's keyboard when the keys labels aren't accurate. Don't remap if other people will be typing on your keyboard.

This last remark is disquieting. Are you perchance suggesting that some people find caps lock actually useful. DO THEY NEVER GET A SORE THROAT OF ALL THE SHOUTING?

Believe it or not, some people use their keyboards for purposes other than newsgroups and e-mail. I use Caps Lock a lot more than I use Control. I have to type things like "CORBA", "DCOM", ".NET", "MAX_INT", "#ifdef DEBUG", etc. quite a lot. The only time I use Control is when I have to use Emacs or when I need to kill a process in Unix. Believe it or not, that's why people switch it. Programmers use control very frequently, especially when using the EmacsEditor.

I don't think I ever use Caps Lock. If I need to type an ALLUPPERCASE word, I hold Shift with my left pinky. Q, A, and Z (or double-quote, A and colon on a DvorakKeyboard) are easy enough to type with the ring-finger. I think I may have picked up the habit from an editor I used to use which let you remap the keys (and I remapped it to Dvorak), but Caps Lock always affected the same keys (and so didn't work for S, W, V and Z, and had an unwanted effect on ["'<,>.:;])
Others use emacs exclusively, which renders CAPS_LOCK obsolete, due to the upcase-word
and upcase-region functions (M-u and C-x C-u, respectively).

The best keyboard ever made, hands down, is the IBM Model M Keyboard (IBM part no. 1391401) with its heavy base and incredible tactile feel. However, it too suffers from the Caps Lock/Control swap design deficiency of the standard 10x-key layout, so these workarounds are a must. Or, you could order an Omnikey Customizer board from http://www.pckeyboard.com ; they sell new keyboards made to the original Model M specifications, and this particular model (sometimes referred to as "Linux 101") puts Control where it belongs - and as a bonus, also moves Escape to a location where it's far more accessible for touch typists. At $69 it's not cheap, but that's the same price as the Happy Hacking Keyboard Lite... and the HHK doesn't have the tactile response of a Model M.

Heh, I'm a model M fan too. I managed to dig up one of the original IBM PC/AT 84 key keyboards, which have the control key in the correct place. (But get the enter key wrong...) And it just so happens the keycaps are intercangeable, and of the exact size needed to fit on a Model M! So I have a Model M with the control correctly labled and in the right place, and doesn't even have the "bite" taken out of it. And caps lock is in the lower left.

But then I had the incredible luck to stumble upon a brand new IBM Model M15 ergonomic folding keyboard being thrown out! A clicky ergo keyboard, rock on! I didn't know these existed, and apparently most other Model M fans don't either. However it uses slightly different keycaps, also used by the Model M2, so I can't use properly labeled keycaps. On this one I ended up not only remapping caps lock to control, I switched the tilde keycap to where control was, (Control and alt are normal sized keys on these), the escape key to where tilde was, and the control keycap to where escape was. IBM put escape WAY off to the upper left on these. Yes, I am a Vim monkey... The duplicate arrow keys on the left side are kind of neat, but I wish I could remap them separately from the right. And the way the 'edit' keys were shoved into the upper right, far from the arrows is kind of annoying. Here's what an M15 looks like:
http://www.clickykeyboards.com/index.cfm/fa/items.main/parentcat/9231/subcatid/0/id/125888.

---
The Avant Prime and Avant Stellar keyboards have remappable keys (http://www.cvtinc.com). The keyboards come with remapping software for Windows; doing it manually is feasible, but annoying. Even better, the keyboards come with extra keycaps for Control and Caps Lock, after you swap them. It's based on the Northgate Omnikey design, and the keyboard action is comparable to an Omnikey. Note that the Avant Stellar has function keys down the left hand side as well as across the top, and both have Windows keys (I use them to make Alt and Meta distinct modifiers under X11).
VimTextEditor users might want to remap caps lock to escape, to give them a more natural way to jump between modes. At any rate, there are few times when having caps lock on the home row is useful. Definitely a ZombieTechnology?.
CategoryRant
I've found that the easiest way to remap Caps Lock to Control on Windows 2000/XP is to use the registry editor. You've got to insert a binary value to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet?\Control\Keyboard Layout\Scancode Map. I found (after a couple of tries) that the value "00 00 00 00 00 00 00 00 02 00 00 00 1D 00 3A 00 00 00 00 00" does quite well when you want to remap your Caps Lock as a "Left Control" -key. For further information: http://www.microsoft.com/whdc/hwdev/tech/input/w2kscan-map.mspx

If I had to type HKEY_LOCAL_MACHINE\SYSTEM\, I would use Caps Lock. ;-) -- BrianRogers

No need. It's easy to type HKEY_LOCAL_MACHINE\SYSTEM\ without Caps Lock. Just hold Shift with your left pinky and type the "A"s with your ring finger. You've got to use Shift to type the underscores anyway...

Or, with a KinesisKeyboard or other good keyboard, just do it in hardware (well, in the keyboard's firmware). Works with every OS, don't need to set it up on each new system. Personally, I like where Kinesis puts control, so I have caps lock mapped to expose.

Update, about two months later: I've now mapped caps lock to work as a shift key, and am using the shift key as expose... so shift (my most common non-text key) is just to the left of A, and expose is still accessible. -- AdamBerger

I, too, have no use for a CAPS LOCK key. On the other hand, I have always wanted a single key for switching layouts (e.g. Latin/Cyrillic). Having discovered MSKLC, I made a custom keymap that has Latin characters in normal mode and Cyrillic in Caps, and I can tell it's a big improvement over default Windows-provided Ctrl+Shift or Alt+Shift. As a bonus, it shows me the current layout with the Caps LED. -- YuriKhan?

Yes, CapsLock is a good switcher for keyboard layouts, so it has been default Latin/Cyrillic Cyrillic switch in some Unix-like OSes (at least in FreeBSD) for many years. Also, layout indicator on the keyboard itself - so now, the right use for CapsLock, no longer useless. -- VadimGoncharov?

I wish I had read this page sooner. Almost every keyboard I own has had it's caps lock key pried off. I just now put the key cap back on on my mac thanks to having discovered: MacOsX>UnderTheApple>SystemPreferences>KeyboardAndMouse>ModifierKeys>CapsLock>NoAction>OK !! -- ChrisGarrod

More on the subject of Capslock removal or rearranging can be found on AnticAPSLOCK (http://www.anticapslock.com), a movement dedicated to getting rid of the key.

mAyBE tHIs iS noT sUCh A gOod ideA aFTeR alL. iT HaS sIDe efFeCts.

I use WinKeyPlus? (http://www.winkeyplus.com) to remap capslock and disable F1.
Try Karabiner (https://pqrs.org/osx/karabiner/) on Mac OS X to bind the Return-key to a Control-key too. Any chance a similar software is found on Windows world? -- JonneItkonen