Windows 中的 AHK Across Script 即使在指示释放时也按住按钮

AHK Across Script in Windows Holds Down the Button Even When Instructed to Release

我在尝试触发的不同脚本中有一个热键程序 (#u::),它似乎有错误行为。

脚本 #1:

#MenuMaskKey vk07
#u::
msgbox,,test
return

试图触发 #u:: 热键的脚本 #2:

#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

顺便说一句,所有其他修饰符都会出现这种情况,例如 shift、alt 和 control。

我使用的是最新版本 (v1.1.26.01)。

试试这个:

脚本#1:

#InstallKeybdHook
#UseHook
#MenuMaskKey vk07

#u:: msgbox, test

试图触发 #u:: 热键的脚本 #2:

#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}