
Hitting Caps Lock by accident turns a sentence into IN UPPER CASE, and fixing it means retyping. Windows has no built-in screen for changing what a key does. The usual fix is a registry value named Scancode Map, which tells Windows to treat one key as another, or as nothing at all. It works on Windows 2000, XP and Server 2003, and current guides also report it working on Windows 10.
The same value can swap keys, turn Caps Lock into Ctrl or Shift, and turn any key into any other. This page covers the method and a table of scan codes, the numbers that identify each key.
How do I turn off or remap Caps Lock in Windows?
The registry is Windows’ settings database, and a wrong edit can cause problems. Export a backup of the registry first, and only continue if you are comfortable with it.
- Open Registry Editor by typing regedit into the Start menu or Run box.
- Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout. Do not edit the similarly named Keyboard Layouts key, which has an extra “s”.
- Choose Edit, then New, then Binary Value, and name it Scancode Map.
- Double-click the new value and enter the bytes for the change you want (examples follow).
- Close Registry Editor, then restart. Logging off and on may also be enough.
To disable Caps Lock entirely, enter these bytes:
00 00 00 00 00 00 00 00 02 00 00 00 00 00 3A 00 00 00 00 00
To make Caps Lock behave as a Left Shift key, which gives capitals only while the key is held, use this instead:
00 00 00 00 00 00 00 00 02 00 00 00 2A 00 3A 00 00 00 00 00
The real Left Shift key keeps working normally.
How is the Scancode Map value built?
The value is a series of 4-byte groups. Two groups of zeros come first, and the third holds the number of entries, counting a final empty terminator. A single remap therefore shows 02. Each remap is then four bytes: the new key’s code (two bytes), followed by the code of the key you physically press (two bytes). A closing group of zeros ends the value.
In the Shift example, 2A 00 is Left Shift, the new behavior, and 3A 00 is Caps Lock, the key you press. For the disable example, the new code is 00 00, which means nothing.
How do I remap several keys or swap two keys?
Add more four-byte remaps to the same value and raise the entry count to match. The count is one more than the number of remaps: 03 for two remaps, 04 for three, and so on.
Caps Lock to Left Shift, plus Left Alt to Backspace, looks like this:
00 00 00 00 00 00 00 00 03 00 00 00 2A 00 3A 00 0E 00 38 00 00 00 00 00
Once Caps Lock is remapped, you may want it back on a seldom-used key. Scroll Lock can take over the job with the pair 3A 00 46 00. Other common examples:
- Caps Lock to Left Ctrl: 1D 00 3A 00 with the count set to 02.
- Swap Caps Lock and Left Ctrl: count 03, then 1D 00 3A 00 and 3A 00 1D 00.
- Print Screen to Left Windows key: 5C E0 37 E0 with the count set to 02.
Can I use a .reg file instead of typing bytes?
Yes. A .reg file is a plain text file that Windows merges into the registry. Create a text file ending in .reg containing the following, with a blank line at the end:
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,2a,00,3a,00,00,00,00,00
Right-click the file and choose Merge, or import it from Registry Editor, then restart. Replace the bytes after hex: with any sequence from this page. The same bytes go in as a binary value or as comma-separated hex in a .reg file.
Which scan codes are common?
| Key | Scan code |
|---|---|
| Escape | 01 00 |
| Backspace | 0E 00 |
| Tab | 0F 00 |
| Enter | 1C 00 |
| Left Ctrl | 1D 00 |
| Left Shift | 2A 00 |
| Right Shift | 36 00 |
| Left Alt | 38 00 |
| Space | 39 00 |
| Caps Lock | 3A 00 |
| Num Lock | 45 00 |
| Scroll Lock | 46 00 |
| Left Windows | 5B E0 |
| Right Windows | 5C E0 |
| Delete | 53 E0 |
Codes ending in E0 belong to extended keys. Enter them exactly as written, in the same order.
Can the change apply to one user only?
On older systems such as XP, the same value can be placed under HKEY_CURRENT_USER\Keyboard Layout. It then applies only to that account after the next login, and another account keeps the normal layout. The machine-wide HKEY_LOCAL_MACHINE location is the one most current guides use, and it affects every account on the PC.
How do I undo the change?
Open Registry Editor, return to the Keyboard Layout key and delete the Scancode Map value. Then restart, or log off and on. If you saved a matching .reg file, keep it so you can see exactly what was changed.
Is there an easier tool?
SharpKeys is a free utility that writes the same registry value for you through a list of keys, so you do not need to look up hex codes. It can map one key to another, map several keys to one, and swap two keys. Changes take effect after you log out and back in or restart.
It has limits that apply to the registry method as well:
- It cannot turn a key combination such as Ctrl+C into a single key.
- It cannot map mouse clicks.
- It cannot reach hardware keys that never reach Windows, such as most Fn keys and some manufacturer volume buttons.
- The setting covers the whole machine, not individual users.
Some reports from Windows 10 say a remap can fail for particular shortcuts. If a remap does not seem to apply, check the byte count and the order of the codes first, then restart fully.