In windows 8 I used to remap my capslock key to control using the registry script


[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

After having upgraded to window 10, this does not work anymore. How can it be done?

  • Note this only remaps Caps Lock to another Ctrl key. I want them swapped, so I used the instructions here to tweak the script above: – jia103 Sep 20 '17 at 15:00
up vote 68 down vote accepted

Did you remember to re-boot? Seems to work fine for me, just like in 7 and 8.

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,3a,00,00,00,00,00
  • That must have been it. Thanks! – Chiel ten Brinke Aug 3 '15 at 6:47
  • 7
    The issue for me was that the Windows 10 upgrade reset my caps lock mapping. But doing it again the same way worked after another restart. – Jack O'Connor Dec 1 '15 at 2:48
  • 29
    If anyone else like me needs the final piece of the puzzle: paste the above into a new text file, save it with the .reg extension, double click the file to apply the changes to the registry, then reboot. – Mike Niebling Sep 6 '16 at 0:00
  • 2
    How do you map it back to Caps Lock afterwards? – Ehtesh Choudhury Dec 1 '16 at 1:36
  • 2
    @EhteshChoudhury you can delete the "Scancode Map" entry under the registry key, reboot, and default behavior will be restored. – bojolais Apr 11 '17 at 19:16

In case anyone needed this done via PowerShell:

$hexified = "00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00".Split(',') | % { "0x$_"};

$kbLayout = 'HKLM:\System\CurrentControlSet\Control\Keyboard Layout';

New-ItemProperty -Path $kbLayout -Name "Scancode Map" -PropertyType Binary -Value ([byte[]]$hexified);

Run it as Administrator and reboot.

  • 8
    Have an upvote for giving a Linux-like "copy&paste into shell" answer! – mikezter Sep 8 '17 at 8:44
  • 1
    Seriously. I miss having *initrc scripts. Thanks. – stewSquared Apr 24 at 20:18

You can use SharpKeys to map any key to any other key in Windows 7, 8, or 10. It's much easier and cleaner to do than to modify the registry yourself.

Hope this helps.

I use the following to send CTRL for the CAPS LOCK key, send ALT for the CTRL key, and send CAPS LOCK for the ALT key. CTRL is to the left of "A" where God intended it, ALT is below SHIFT, and the utterly useless CAPS LOCK key is safely tucked away where I have to break my wrist to hit it.

Windows Registry Editor Version 5.00

; The hex data is in five groups of four bytes:
;   00,00,00,00,\    header version (always 00000000)
;   00,00,00,00,\    header flags (always 00000000)
;   04,00,00,00,\    # of entries (3 in this case) plus a NULL terminator line.
;                    Entries are in 2-byte pairs: Key code to send & keyboard key to send it.
;                    Each entry is in LSB, MSB order.
;   1d,00,3a,00,\    Send LEFT CTRL (0x001d) code when user presses the CAPS LOCK key (0x003a) 
;   38,00,1d,00,\    Send LEFT ALT (0x0038) code when user presses the LEFT CTRL key (0x001d) 
;   3a,00,38,00,\    Send CAPS LOCK (0x3A) code when user presses the LEFT ALT key (0x0038) 
;   00,00,00,00      NULL terminator

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,\
  • 1
    I really appreciate the comments. I always wondered what the codes meant. Very helpful. – zaphodtx Aug 8 at 22:01

You can use lswitch to remap language input to CapsLock.

Use any key to switch input languages, usage: lswitch [keycode]. Keycode is optional and defaults to context menu key. Another good candidate is a CapsLock key with a keycode of 20.

lswitch 20

Add it to autoload.

I used to use AutoHotKey to do this.

I'd have a link in the startup directory to run a very basic ahk script:


The thing is, Autohotkey isn't run as Administrator so it won't affect privileged windows, unless you use the task scheduler instead of the startup directory to run the script at login with higher privileges. The second problem is that sometimes, the script hangs when resuming sleep, so you may need to reload it, which is annoying.

AutoHotKey is better suited for more complex tasks, like writing macros.

This is the script to swap CTRL and CAPS LOCK keys:

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,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.