Autohotkey 自动热键-3次按键?
好的,快速提问。我有一个脚本,它在按下鼠标右键+按下ctrl键时运行 如何扩展此脚本,以便在按下左ctrl+w+右鼠标时,将执行不同的脚本,但不会执行第一个脚本 那么,如果我按下LCtrl+w+RButton,一件事会执行,如果我按下LCtrl+RButton,另一件事会执行 我希望这不会太令人困惑 我试过的例子Autohotkey 自动热键-3次按键?,autohotkey,Autohotkey,好的,快速提问。我有一个脚本,它在按下鼠标右键+按下ctrl键时运行 如何扩展此脚本,以便在按下左ctrl+w+右鼠标时,将执行不同的脚本,但不会执行第一个脚本 那么,如果我按下LCtrl+w+RButton,一件事会执行,如果我按下LCtrl+RButton,另一件事会执行 我希望这不会太令人困惑 我试过的例子 ~LCtrl & ~RButton:: ; do something #if GetKeyState("RButton","LCtrl") && GetKey
~LCtrl & ~RButton:: ; do something
#if GetKeyState("RButton","LCtrl") && GetKeyState("RButton","LCtrl")
~w::
; do something
return
#if
问题是,当我尝试执行左ctrl+right button+w时,第一个脚本也会执行。三重组合很难使用。我能想到的最好办法是: 方法1:
~LCtrl & ~RButton up::
Input, key, L1 T0.5
if (key == "w")
MsgBox % "You pressed LCtrl & Rbutton & W"
else
MsgBox % "You just pressed LCtrl & RButton"
return
方法2:
~LCtrl & ~RButton::
While (A_TimeSinceThisHotkey < 500) {
If (GetKeyState("w", "P")) {
MsgBox % "You pressed LCtrl & RButton & W"
return
}
}
MsgBox % "You Pressed LCtrl & RButton"
return
这方面的标准语法是
#if getkeystate("w", "P") ; # this "#if" is only for hotkey definitions conditions, not to be confused with "if"
LCtrl & RButton::
; do this
return
#if ; end of hotkey conditions
LCtrl & RButton:: ; w is not pressed
; do that
return
这个问题已经存在多次了