Thursday, June 21, 2012

Mapping Caps Lock to Control on Windows 7

I find the Caps Lock key completely useless. On all my computers, I map it to the control key. This is rather straightforward to do on a Mac and in Linux, but slightly harder on a Windows 7 machine. Just slightly.

There are a few different tricks that exist on the web, but the easiest I found was the registry hack - all you need to do is create a new REG_BINARY key in HKLM/System/Control/Keyboard Layout (note the singular) called Scancode Map , put in the value below, and restart your machine.

Here is the MSDN article on the Scan Code Mapper. Basically, you can instruct it to remap keys to do whatever you wish. Two common configurations:


1. Map Caps Lock to Control (this is what I use) -  
00000000 00000000 02000000 1D003A00 00000000


2. Swap Caps and Control (I have no idea why someone would want to do this)
00000000 00000000 03000000 3A001D00 1D003A00 00000000

Obviously, use this at your own risk (though I think the risk of something going dramatically wrong is very minor). For the nerds, read the aforelinked MSDN article - the numbers actually make sense.