Jun 132007

A lot of people suggest turning the Caps Lock key into a Control key. The more I’ve thought about it, the more it does actually make sense. The Caps Lock key enjoys prime real estate on the keyboard, typically right next to the home row, while its function is only rarely (if ever) required. For many applications (such as my favourite editor Vim) the Control key is a regularly used and vital element of, well, control.

Searching the web uncovered numerous hints about swapping the funcitons of the Caps Lock and Control keys under GNU/Linux. My solution uses xmodmap, and was based on the ideas found here and here.

I created a file called ~/.xmodmap with the following contents:

!! Swap Caps_Lock and Control_L
remove Lock = Caps_Lock
remove Control = Control_R
keysym Control_R = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L

Adding the following line to my ~/.xinitrc (before the command to execute Enlightenment, my window manager) resulted in the key swap being active each time I start an X session:

xmodmap ~/.xmodmap &

My .xmodmap file turns the Caps Lock into a Control key, and makes my right hand side Control key into the Caps Lock. This means that my left hand side Control key (which is the one I always used) remains unaltered.

Remapping these keys in X was the easy part; I’m still waiting for the neurons in my brain to remap to the new and luxuriously located Control key.

  One Response to “Swapping the Caps Lock and Control keys”

  1. It would also limit the ammount of times you accidently SHOUT AT PEOPLE (oh oops, caps lock again…) on line

    tee hee

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>