即使指示发布,在Windows中跨越脚本的AHK也会按下按钮

时间:2017-09-25 15:11:54

标签: windows-10 autohotkey

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

脚本#1:

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

尝试触发#u :: hotkey的脚本#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 个答案:

答案 0 :(得分:1)

试试这个:

脚本#1:

#InstallKeybdHook
#UseHook
#MenuMaskKey vk07

#u:: msgbox, test

尝试触发#u :: hotkey的脚本#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}