Autohotkey 按住按钮后的人民币并单击

Autohotkey 按住按钮后的人民币并单击,autohotkey,Autohotkey,我想不出来 我正在努力完成这样的事情: 按GUI按钮 当我点击鼠标下一步持有人民币 当我再次点击释放人民币 当前工作: Toggle=0 GUI, Add, Button, w50 h50, Nbutton GUI, Show, x50 y50 return ButtonNButton: { Toggle:=!Toggle } if GetKeyState("LButton","P") if (T

我想不出来

我正在努力完成这样的事情:

  • 按GUI按钮
  • 当我点击鼠标下一步持有人民币
  • 当我再次点击释放人民币
  • 当前工作:

        Toggle=0
        GUI, Add, Button, w50 h50, Nbutton
        GUI, Show, x50 y50
        return
    
        ButtonNButton:
        {
            Toggle:=!Toggle
        }
    
        if GetKeyState("LButton","P")
            if (Toggle == 1)
                MsgBox, Do
                Toggle:=!Toggle
        return
    

    这应该可以实现你想要的

    请注意,现在,这个示例脚本仅限于在记事本中使用。您应该更新脚本,以针对您希望热键处于活动状态的任何程序/游戏/窗口

    Toggle := 0
    GUI, Add, Button, w50 h50, Nbutton
    GUI, Show, x50 y50
    return
    
    ButtonNButton:
        Toggle:=!Toggle
    
    
        ; Update this line to match whatever window you want the hotkey active
        ; in, or delete this line to make the hotkey active everywhere.
        Hotkey, IfWinActive, ahk_class Notepad
    
    
        if Toggle
        {
            Hotkey, ~*LButton Up, RBSwitch, On
        }
        else
        {
            if GetKeyState("RButton") ;release RButton when hotkey is disabled
                Send {RButton Up}
            Hotkey, ~*LButton Up, RBSwitch, Off
        }
    RETURN
    
    
    RBSwitch:
        if GetKeyState("RButton")
            Send {RButton Up}
        else
            Send {RButton Down}
    RETURN
    

    我不清楚您到底想做什么,尤其是在步骤5和6中。然而,你可能会想用它来为LButton出版社投票。我已经把这个问题编辑得更简单了。