Friday, April 10, 2009

DevTnT 2 - How to switch Control and Capslock keys

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. This posting shortly describes how to swap these two keys.

Make a file named (for example) CapsLockIsCtrl.reg with these three lines:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
Double click it from Windows explorer, reboot.

To put it on the Left-Ctrl key use SwapCtrlAndCapsLock.reg:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00

Alternatively you can manually manipulate the registry by adding the key "Scancode Map" under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Keyboard Layout and enter the hex codes mentioned above:

No comments:

Post a Comment