Last active
October 21, 2021 02:38
-
-
Save JohnL4/be609c3570465db87f5a322f2dccf997 to your computer and use it in GitHub Desktop.
PowerShell script to permanently swap caps-lock and control by registry hack
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
<# Writes a registry entry to swap caps lock and left control permanently. This affects all users and the login screen, and doesn't | |
require any other software to run after this (e.g., PowerToys). Requires a reboot after this script is run to take effect. | |
Courtesy of https://www.mavjs.org/post/swap-ctrl-and-capslock-on-windows/ | |
#> | |
$hexified = "00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment