I download "SharpKeys.exe" from here. It works well. But I want to change "Pause/Break" to another, this app cannot recognize this key correctly. Does any one know the scancode? Thx
Pause is a very special non-typematic key with an unusual scan code (E1 1D 45 E1 9D C5
). This is too long to be remapped using SharpKeys (or any program that uses the registry to do scan code remappings, since this feature is limited to 2-byte scancodes). If you try to remap it, you'll get only the first two bytes, and end up remapping the Num Lock key instead. This breaks in all sorts of hilarious ways.
You will need to use another program to do the remapping, perhaps something like AutoHotKey. But I'm not sure this will actually work, given how special this key is.
It is not clear why a programmer would ever want to remap Pause/Break. This is a very useful key, one that is often painfully missing from laptop keyboards where your only option is to remap another key to Ctrl+Break (scan code E0 46
). This gives you back at least part of the function of a real Pause/Break key.
I remapped Pause / Break key flawlessly using only SharpKeys! This is how I did it:
I also downloaded SharpKeys (which, by the way, is awesome), and at first was also unable to change the Pause/Break key to another key (my case wanna change to Media:Play/Pause).
After a little research, found this page blog: https://www.neox.net/w/2008/02/13/keyboard-remap-pause-break-key-as-del-key/
There, the guy was able to remap the key just using the first 2 bytes of the sequence. E1
and 1D
. (he also messed around with Del
key, which is unnecessary)
Since SharpKeys is already a great tool, I just download its code and added to the key map table this key code E1 1D
and was able to remap using it without any further modifications.
Long story short:
I downloaded the source code of SharpKeys, and added to its code, file Dialog_Main.cs
, method BuildParseTables()
, the line m_hashKeys.Add("E1_1D", "-by Vitox: Pause/Break");
After that, I was able to remap the Pause/Break key flawlessly.
Resources:
Source code of SharpKeys, after changes
Interface of SharpKeys, after mod
SharpKeys: https://github.com/randyrants/sharpkeys
by the way, Randy Rants, this is a great tool. Thank You!
note: the keyboard where this mod worked was a Logitech G413, and OS was Windows 7
You must edit: E11D to Delete and E046 to Delete
There is file to download: https://www.neox.net/w/2008/02/13/keyboard-remap-pause-break-key-as-del-key/
I know this is a former topic, but maybe someone has MSI GL75 with a senseless keyboard like me :)
Glad people are liking the tool but to be clear, Pause/Break is a special key that is not easily remapped. The Windows technology that remaps the keys only supports double-byte enabled scancodes. Some newer keys are triple-byte and those are dropped to the floor. Pause/Break is a hextuple-byte scancode.
By remapping the first part of that you may have successfully remapped Pause/Break but you are also remapping every other key that starts with E1 1D
as well. On your keyboards this may not matter but I wouldn't recommend trying it without a backup plan.
I also highly recommend Microsoft's PowerToys for remapping modified keys (e.g. Ctrl+C) or weird keys that SharpKeys cannot map.
HTH!
The insight from @Vitox is really helpful. Yet, the visual code community is quite a chunk and if you don't wanna bother to compile the modded version yourself, I have a simple solution here.
The scan code for Pause/break key is (E1 1D 45 E1 9D C5
). The simple approach is to make the configuration via sharpkeys and remap Special: Hanja Key (E0 F1)
to the desirable key, say F11 (00 57)
.
Open registry, navigate to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
, and export all the stuff in the path of [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
to a .reg file. Open the .reg file, locate the f1,e0
segment (you can search ",f1,e0,
"), change f1 to 1d and e0 to e1, save and import to registry.
Then the trick will do after a restart.
You will also see the configuration in sharpkeys. See proof. However, it is not possible to export them from sharpkeys side. Sharpkeys will ignore that (E1_1D)-(00 57) pair that is not natively built-in.
PS: This is a simple configuration replacement and absolutely do in my environment on Windows 10. Nonetheless, it's just a sidestep saving you from installing 10+ gigabytes (or 20+? whatever) of MS visual studio community. I really hope someone could release a built version of sharpkeys to natively support the pause/break key remapping.
thank you, @Vitox for the correct "Pause" E1_1D code, i was not able to find it in the "unknown codes" in SharpKeys
I was able to remap my pause key to print screen in powershell (windows in bootcamp, long story short.. wanted Fn+ESC to take screenshots, and Fn+ESC registers as "pause"
here's the ps1:
$regPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout"
# Pause/Break = (E1_1D) to PrintScreen = (E0_37)
$scancodeMap = @(
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00,
0x37, 0xE0, 0x1D, 0xE1, # Pause/Break (E1_1D) to Print Screen (E0_37)
0x00, 0x00, 0x00, 0x00
)
$byteArray = [byte[]]$scancodeMap
Set-ItemProperty -Path $regPath -Name "Scancode Map" -Value $byteArray
# Dont forget to restart
after the script was run, sharpkeys says map this key (E1_1D) to "special: PrtSc (E0_37)
Thanks for the help again!
© 2022 - 2024 — McMap. All rights reserved.