【问题标题】:How do I make an Auto Clicker Macro in LUA script inside Logitech ghub?如何在 Logitech ghub 内的 LUA 脚本中创建 Auto Clicker 宏?
【发布时间】:2021-04-04 09:47:00
【问题描述】:

我正在尝试制作一个自动点击器,在我的 g703 上按住鼠标 5 按钮时会重复。它应该继续发送 PressAndReleaseMouseButton(1) 函数,直到我不再按住鼠标 5 按钮。 这是目前我的代码:

EnablePrimaryMouseButtonEvents(true)

function OnEvent(event, arg)
   if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
      repeat
         Sleep(15)
         PressAndReleaseMouseButton(1)
         Sleep(15)
      until not IsMouseButtonPressed(5) 
   end
end

但是,当我希望它在按住鼠标 5 的同时重复发送点击时,这只会在我按下鼠标 5 按钮时发送一次点击。我需要做什么来解决这个问题?

【问题讨论】:

  • 您可能更改了物理按钮 #5 的默认绑定(“前进”)。你应该去GHUB中的“Assignments”鼠标页面,点击MB#5对应的白色圆圈,然后从下拉列表中选择“USE DEFAULT”。

标签: lua macros logitech logitech-gaming-software


【解决方案1】:

你可以试试这个代码:

EnablePrimaryMouseButtonEvents(true);
function OnEvent(event, arg)
if IsKeyLockOn("capslock")then
if  IsMouseButtonPressed(5)then
   repeat
   MoveMouseRelative(0,4)
   PressMouseButton(1)
   Sleep(1,2)
   ReleaseMouseButton(1)
   until not IsMouseButtonPressed(5)
end
end
end

【讨论】:

    猜你喜欢
    • 2020-03-12
    • 2021-03-16
    • 2021-09-15
    • 1970-01-01
    • 2023-01-03
    • 2021-09-12
    • 2021-01-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多