Created
February 22, 2026 23:38
-
-
Save cuevasclemente/9febb97ec87b8d8d6e0b5302a2218e6d to your computer and use it in GitHub Desktop.
Caps to Control Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Remap Caps Lock to Left Control (run as Administrator, then reboot) | |
| $path = "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" | |
| $value = [byte[]]( | |
| 0x00,0x00,0x00,0x00, # Header version | |
| 0x00,0x00,0x00,0x00, # Header flags | |
| 0x02,0x00,0x00,0x00, # 2 entries (1 mapping + null terminator) | |
| 0x1D,0x00,0x3A,0x00, # Caps Lock -> Left Control | |
| 0x00,0x00,0x00,0x00 # Null terminator | |
| ) | |
| Set-ItemProperty -Path $path -Name "Scancode Map" -Value $value -Type Binary | |
| Write-Host "Done. Reboot to apply." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Undo Caps Lock to Control remap (run as Administrator, then reboot) | |
| $path = "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" | |
| Remove-ItemProperty -Path $path -Name "Scancode Map" | |
| Write-Host "Done. Reboot to apply." |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
powershell -ExecutionPolicy Bypass -File capslock-to-ctrl.ps1