尝试将中间点击按钮分配给 LUA 自动点击器脚本 (罗技 G203 鼠标)

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

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

原文链接 https://stackoverflow.com/questions/69063739

点赞
stackoverflow用户1847592
stackoverflow用户1847592

Logitech 鼠标的按键枚举是不平凡的 :-)

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
2021-09-05 18:20:15