Autohotkey 的按住功能

Push and Hold Functionality for Autohotkey

我有一个接受双击输入的自动热键没问题。我也想添加一个 'Push and Hold' 函数,但我无法完全解决不断试验它的问题。

这是 TL;DR

我想单击鼠标中键发送一个 •

我想双击鼠标中键发送一个 ▪

我想要按住鼠标中键发送一个◦

Link 到 API: https://autohotkey.com/docs/commands/KeyWait.htm

MButton::
KeyWait, MButton
KeyWait, MButton, D T.3
if(!ErrorLevel){
Send ▪ 
}
else{
if(!ErrorLevel){
KeyWait, MButton, D T.2
Send ◦
}
else{
Send •
return
}
}

return

以上有什么问题吗?

MButton::
    KeyWait, MButton, T0.3
    If !(ErrorLevel)
    { 
        Sleep, 300
        If (A_PriorHotKey = "MButton Up") ; double click
            Send ▪
        else                              ; single click
            Send •
    }
    else                                  ; push-and-hold
        Send ◦
return

MButton Up:: return