【问题标题】:Trying to assign middle click button to LUA autoclicker script (Logitech G203 Mouse)尝试将中间单击按钮分配给 LUA 自动点击器脚本(Logitech G203 鼠标)
【发布时间】:2021-11-02 21:44:37
【问题描述】:

我想知道当我点击鼠标的中间(滚动)按钮时,如何打开这个自动点击器。当我按下其中一个侧面按钮时,此脚本似乎可以工作,但我似乎无法弄清楚如何使它适用于我的中间按钮。

EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
   --OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
   if event == "MOUSE_BUTTON_PRESSED" and arg == 4 then 
      repeat 
         PressAndReleaseMouseButton(1)
         Sleep(math.random(30, 60)) 
      until not IsMouseButtonPressed(4) 
   end
end

【问题讨论】:

    标签: lua logitech logitech-gaming-software


    【解决方案1】:

    罗技鼠标按钮枚举很重要 :-)

    EnablePrimaryMouseButtonEvents(true)
    function OnEvent(event, arg)
       --OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
       if event == "MOUSE_BUTTON_PRESSED" and arg == 3 then -- 3 = middle
          repeat 
             PressAndReleaseMouseButton(1)
             Sleep(math.random(30, 60)) 
          until not IsMouseButtonPressed(2) -- 2 = middle
       end
    end
    

    【讨论】:

    • 啊哈!谢谢!
    猜你喜欢
    • 1970-01-01
    • 2021-10-12
    • 2012-11-14
    • 1970-01-01
    • 2023-01-03
    • 2020-11-05
    • 2019-11-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多