-3

我正在尝试制作一个脚本,使我能够继续按下某个键,例如“1”,当我按住鼠标左键超过 0.5 秒时,它将继续直到我释放鼠标左键。

希望有人可以帮助我。

4

1 回答 1

1

你可以试试这样的。我使用鼠标中键进行测试。

我注释掉了特定于应用程序的行。

SetTitleMatchMode, 2 ; Put at the top of your script.

MButton:: ; Start this script when the Middle Mouse Button is pressed
;ifWinActive, Your Application Name ; Place the application name as in the windows title.
;{
    KeyWait, MButton, T0.5 ; Wait for MButton to be released within 0.5 sec
    if  (ErrorLevel) ; Not released within 0.5 sec.
    {
        Send, {1 Down} ; Press 1 down, will not autorepeat unless placed in a while loop
        KeyWait, MButton ; Wait for Mbutton to be released
        Send, {1 Up} ; Once MButton is released, undo the press 1 down
    }
    else ; If MButton was released within 0.5 sec.
    {
        Click ; press click
    }
;}
;else
;{
;   Click ; perform normal click behaviour when outside of the target application
;}
Return
于 2013-01-31T19:11:02.393 回答