Google

Net Neutrality Canada - Neutrality.ca
Save the Net

Here is how to swap the Caps Lock and Left Control keys in X-Windows on Unix-like systems (e.g. Linux, FreeBSD, NetBSD, ...) and Microsoft Windows operating systems. (If anyone would like to contribute instructions for MacOS X, please email me.) I'm not going to discuss why anyone would want to swap these keys; if you are looking at this page, you probably already know why and just want to know how. Off we go.

X-Windows with KDE

This is my preferred environment so I'm putting it first :) KDE makes it really easy.

  1. Go to the Control Centre (on the K menu)
  2. Expand Regional & Accessibility and choose Keyboard Layout
  3. Choose the Xkb Options tab and enable the options
  4. Scroll down until you see Ctrl key position, then choose Swap Ctrl and CapsLock.

X-Windows with GNOME

Gnome also makes changing the keyboard layout very easy.

  1. Go to the System menu. Choose Preferences, Hardware, then Keyboard.
  2. Click on the Layout Options tab
  3. Expand the Ctrl key position menu and click on Swap Ctrl and CapsLock (or on Make CapsLock an additional Ctrl if you prefer).

Vanilla X-Windows

This is a bit harder. You will need to edit your X-Windows config file, which is normally either /etc/X11/XF86Config-4 or /etc/X11/xorg.conf.

  1. Find the section for the primary keyboard (there's usually only one). It will look something like this:
    Section "InputDevice" Identifier "Keyboard0" Driver "kbd" Option "XkbModel" "pc105" Option "XkbLayout" "us+inet" EndSection
  2. Add this line:
    Option "XkbOptions" "ctrl:swapcaps"
  3. Save the file and restart X

Microsoft Windows 2000 and XP (and Vista?)

Microsoft made this most decidedly not easy. You will need to edit a horrible hex sequence in the registry to make it work. This Microsoft article explains how to do it. However, you are probably better off grabbing one of the many available registry files that will import the key for you. Like this one from manicai.net, or this one from johnhaller.com.

WARNING: Use the registry files above at your own risk. They are not mine. I simply linked to two of the files I found.