Edit1: The reason why pressing another key after holding down LShift gets the correct result, was probably because auto-repeat of LShift stops once another key is pressed.
The bug occurs when doing following things:
- Set a mouse hotkey
- Use SendInput (not SendEvent) inside the mouse hotkey
- Set another hotkey for a keyboard key
Testing environment: AHK 1.1.29.01, Windows 10 1803 (build 17134.167), USB keyboard/USB mouse.
Here is an example:
Code: Select all
#HotkeyInterval 100 ; to prevent popup warning
#KeyHistory 500 ; for better log analysis
#NoEnv
SendMode Input ; Problem occurs with SendInput
; Set a mouse hotkey. Scroll down your mouse wheel to send "a"
*WheelDown::
Send, {Blind}{a}
return
; Ignore LShift (another hotkey)
*LShift::return
*LShift up::return
; A rescue key to recover LShift from being permanently down
*PrintScreen::
Send, {Blind}{LShift up}
return
If you don't reproduce the behavior, try setting your keyboard repetition rate to the fastest side in Windows.
Also, SendEvent seems to work without the bug too, but it sometimes misses LShift hotkey only when LShift and WheelDown are pressed (sent) at exactly the same time.