Skip to content

Instantly share code, notes, and snippets.

@cuevasclemente
Created February 22, 2026 23:38
Show Gist options
  • Select an option

  • Save cuevasclemente/9febb97ec87b8d8d6e0b5302a2218e6d to your computer and use it in GitHub Desktop.

Select an option

Save cuevasclemente/9febb97ec87b8d8d6e0b5302a2218e6d to your computer and use it in GitHub Desktop.
Caps to Control Windows
# 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."
# 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."
@cuevasclemente
Copy link
Author

powershell -ExecutionPolicy Bypass -File capslock-to-ctrl.ps1

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