Skip to content

Instantly share code, notes, and snippets.

@joshschmelzle
Last active May 30, 2025 19:28
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.

@GhasemSoleimani
Copy link

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

@LifeJustDLC
Copy link

LifeJustDLC commented Apr 13, 2024

@joshschmelzle
Copy link
Author

@life-is-dlc what are you talking about? PowerToys is an actively maintained tool by Microsoft. If you have a problem with their tool, go complain on their repo, not here.

@LifeJustDLC
Copy link

I just can't agree with the term "actively maintained" you're using, since the problem I listed is 3 years ago. Also it is very specific to your solution for switching caps and ctrl. If you're going to use it to switch any keys else, probably fine though I didn't tested.
I'm curious-only in the debug purpose-haven't you run into any problem the issue mentioned? (In case you didn't want to click the link, I edit my post to reveal their titles.)

@LifeJustDLC
Copy link

Maybe my wording of "defective" is not accurate. Sorry about that. English is not my first language. I'm still learning it.

@lovelock
Copy link

The powertoys way may not work in some apps. I choosed the second way and it works.

@LakshmanKishore
Copy link

LakshmanKishore commented Jan 3, 2025

Anyone still searching for mapping capslock to ctrl or esc, there is a minimal tool:
https://github.com/susam/uncap

@chenl
Copy link

chenl commented Mar 17, 2025

To actually swap CAPS and CTRL:

00 00 00 00  00 00 00 00
02 00 00 00  1D 00 3A 00
3A 00 1D 00  00 00 00 00

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