How to remap keyboard keys?

Post Reply
tong
Site Admin
Posts: 2381
Joined: Fri 01 May 2009 8:55 pm

How to remap keyboard keys?

Post by tong »

Understanding How to Re-Mapping keys

4 bytes: Version Information (00000000)
4 bytes: Flags (00000000)
4 bytes: Number of Mapping Keys (including +1 null terminator data)
4 bytes: Key Mapping
4 bytes: Null Terminator (00000000)

0000 = No Key
3A00 = Caps Lock
3B00 = F1
2A00 = Left Shift
3600 = Right Shift
1D00 = Left Ctrl
1DE0 = Right Ctrl
3800 = Left Alt
38E0 = Right Alt
4600 = Scroll Lock

Example: Disables Caps Lock key

00000000 00000000 02000000 00003A00 00000000

Example: Disable Caps Lock key and change Scroll Lock into a Caps Lock key

00000000 00000000 03000000 00003A00 3A004600 00000000


Example: Change Caps Lock key to Left Shift

00000000 00000000 02000000 2A003A00 00000000

Code: Select all

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,2a,00,3a,00,00,00,00,00

Code: Select all

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout" /v "Scancode Map" /t REG_BINARY /d 0000000000000000020000002A003A0000000000 /f
tong
Site Admin
Posts: 2381
Joined: Fri 01 May 2009 8:55 pm

Re: How to remap keyboard keys?

Post by tong »

Example: Disables F1 key

00000000 00000000 02000000 00003B00 00000000

Code: Select all

reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout" /f /t REG_BINARY /v "Scancode Map" /d 00000000000000000200000000003B0000000000
tong
Site Admin
Posts: 2381
Joined: Fri 01 May 2009 8:55 pm

Re: How to remap keyboard keys?

Post by tong »

Understanding How Windows Key Re-Mapping Works
https://www.howtogeek.com/howto/windows-vista/disable-caps-lock-key-in-windows-vista/

Key Scan Codes
https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa299374(v=vs.60)
Post Reply