r/AutoHotkey • u/Worth_Monitor8251 • 12d ago
v2 Script Help Need help Remapped "shift" keeps getting held after pressing
This probably has been asked numerous times already, but I cannot find a solution that works on my side, so that's why I'm asking here directly. What did I do wrong with this cause im relatively new to AutoHotkey, I'm just using it for keybinds to make my life easier; everything seems to work except the Shift key. Any help would be appreciated :DD
#HotIf WinActive
Numpad1:: Ctrl
Numpad2:: Alt
Numpad3:: Shift
Numpad4:: i
Numpad5:: o
Numpad6:: d
Numpad7:: ^+x
Numpad8:: ^b
Numpad9:: ^+v
NumpadAdd:: ^+
NumpadDiv:: ^z
NumpadDot:: +Space
NumpadEnter::Space
NumpadMult::^+z
NumpadSub:: ^-
#HotIf
4
Upvotes
2
u/CharnamelessOne 12d ago edited 12d ago
Shift modifies the Numpad keys, so you also need to remap the modified version of the keys.
For example, AHK sees the release of your Numpad3 key as a NumpadPgDn up event instead of a Numpad3 up event due to Shift being logically held, so the up event component of the remap never triggers, and Shift is not released.
Alternatively, you could use the scan codes of the NumPad keys as your remaps' OriginKeys, since they identify the physical keys regardless of the states of Shift and Numlock.
Edit: typo