问题
I have a hotkey program in a different script that I am trying to trigger (#u::) and it seems to have a buggy behavior.
Script #1:
#MenuMaskKey vk07
#u::
msgbox,,test
return
Script # 2 that is trying to trigger the #u:: hotkey:
#SingleInstance
#NoEnv
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#MenuMaskKey vk07
SendLevel, 10
Send, #{u} ; This successfully triggers the hotkey but now it holds down the # button
sleep, 1000
Send, {RWin Up} ;Here I am trying to release it but it still doesn't let it go
Btw, this occurs with all other modifiers, too like shift, alt, and control.
I am on the latest version (v1.1.26.01).
回答1:
Try this:
Script #1:
#InstallKeybdHook
#UseHook
#MenuMaskKey vk07
#u:: msgbox, test
Script # 2 that is trying to trigger the #u:: hotkey:
#SingleInstance
#NoEnv
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#MenuMaskKey vk07
SendLevel 1
SendInput, {LWin down}u{LWin Up}
If GetKeyState("LWin")
Send {LWin Up}
If GetKeyState("RWin")
Send {RWin Up}
来源:https://stackoverflow.com/questions/46408603/ahk-across-script-in-windows-holds-down-the-button-even-when-instructed-to-relea