4
votes

The Caps Lock key is driving me nuts - I never use it intentionally, but sometimes accidentially press it instead of TAB. My current solution is to remove the button with a screwdriver (no damage, can be placed back if ever needed).

Is there a way to disable the Caps Lock key programmatically on Windows - write a program with a keyboard hook or anything like that? Where do I start?

2

2 Answers

3
votes

To just remap Caps lock (without installing software) on a Windows 2000 or Windows XP machine, I adapted the information found at How to globally map AltGr key to Alt key? as follows. Mapping Caps to null is one of the examples, but you could choose another key to map to as I did. To map caps to null, the registry file is:

Windows Registry Editor Version 5.00

[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,00,00, 00,00,00,00

Save this as filename.reg and execute, then reboot (or log out and log back in).

I based this on the answer from that page by Tomas Sedovic and on Scan Code Mapper for Windows recommended by Ronald Blaschke. I introduced the spaces to allow me/you to see how the bytes are grouped into words.

Note that I actually used this to map Caps to Ctrl and my second to last group of numbers was "1d,00,3a,00" and I confirmed that this works fine.

1
votes

The question How to make a Custom Keyboard layout ? describes how to change the functionality of the Caps Lock key.