The Pragmatic Addict

Convert Caps Lock to CTRL key

I’m still amazed that keyboards still have the Caps Lock key and worse that it’s in the home row of typing. These little hacks will convert that key to a more useful CTRL key.

Debian

apt-get install keyboard-configuration console-setup

In the file /etc/default/keyboard

XKBOPTIONS="ctrl:nocaps"

Windows

Open Powershell as admin and enter the following

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

Created: 2022-10-26 Modified: 2024-04-01