Skip to content

Instantly share code, notes, and snippets.

@joshschmelzle
Last active April 13, 2024 22:39
Show Gist options
  • Save joshschmelzle/5e88dabc71014d7427ff01bca3fed33d to your computer and use it in GitHub Desktop.
Save joshschmelzle/5e88dabc71014d7427ff01bca3fed33d to your computer and use it in GitHub Desktop.
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

You will enter the raw bytes like this (thanks @quapka):

00 00 00 00 00 00 00 00 02 00 00 00 1d 00 3a 00 00 00 00 00

Save. Reboot. Done.

Approach 2. Make your own registry key file.

Thanks @datsuka-qwerty

Create a new .reg file and name it something meaningful like capstoctrl.reg. Edit the file and paste in the following:

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

Save. Run the file. Reboot. Done.

Approach 3. Through PowerShell (as Administrator)

Open PowerShell as an administrator (Win + X)

$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);

Save. Reboot. Done.

Approach 4. Microsoft PowerToys

Give PowerToys a try for remapping not only capslock, but other keys as well. Microsoft PowerToys: Utilities to customize Windows 10.

Microsoft PowerToys: Keyboard Manager enables you to redefine keys on your keyboard.

@rover-random
Copy link

I tried approach 3. It worked for a couple minutes, and now all the sudden caps lock does nothing. What could have gone wrong?

@avlm
Copy link

avlm commented Oct 3, 2022

PowerToys worked pretty fine for me! thanks!

@nosrednayduj
Copy link

Powertoys did not allow remapping of caps lock to "just control". It prompted me to add another key to the sequence after I selected Ctrl.

@rover-random
Copy link

@nosrednayduj once you select ctrl, in the next box that opens up, scroll all the way to the top and select 'None'.

@pythonincloud
Copy link

The above solutions left me without an option to use the CapsLock itself.
This is a reg file to remap CapsLock to CTRL and CTRL ot CapsLock.

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

@asierrayk
Copy link

How do i map it to the right control, in order to be able to diferenciate keys in games?

@eric-gitta-moore
Copy link

For me, Ctrl2Cap is currently the most reliable solution. The registry key "Scancode Map" does work in Windows 10, but strangely stopped working for the Ctrl-X keystroke in particular. The PowerToys Keyboard Manager works, including Ctrl-X, but doesn't work over remote desktop (and running it on the remote PC as well as the local one doesn't seem to let you remap successfully). Ctrl2Cap is remapping in all applications including remote desktop.

https://superuser.com/a/1389340

@karimb
Copy link

karimb commented Sep 5, 2023

The registry key hack works in Windows 7 too.

@GhasemSoleimani
Copy link

Is it impossible to change it for changing keyboard language? (ALT+SHIFT OR WIN key+Space)

@life-is-dlc
Copy link

microsoft/PowerToys#14556
microsoft/PowerToys#21917
You recommended a defective tool at the end. Use SharpKeys instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment