Remix.run Logo
Dwedit 3 hours ago

Sleep key is scancode E05F

In registry "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout"

Create Binary value named "Scancode Map"

Put in there: 00 00 00 00 00 00 00 00 02 00 00 00 3E 00 5F E0 00 00 00 00

That changes scancode E05F (Sleep key) into scancode 3E (F4 key).

Then logout or reboot for the change to apply. I actually looked up what would be necessary to do this change without a reboot, and it turns out that only WinLogon.exe is allowed to make the Scancode Map change.

WorldMaker an hour ago | parent [-]

A tool to help manage these kinds of rebindings is the Keyboard Manager in PowerToys.

As I recall it uses multiple approaches, so it isn't "just" a straight manager of scancode maps, but that also helps it avoid logout/reboot for the initial change to take place.