如何在 G hub 中绑定 Lua 中的左滚动条?

How do I bind scroll left in Lua in G hub?

我有一台罗技 G502 Hero。我想将左滚动条 G11 绑定到自动答题器。我设法通过将它绑定到中键单击并在 Lua 中使用 IsMouseButtonPressed(2) 来做到这一点,但这会删除我的中键单击功能。有什么解决办法吗?

鼠标绑定:

代码:

function OnEvent(event, arg)
Sleep(50)
while(IsMouseButtonPressed(2)) do
PressAndReleaseMouseButton(1)
PressAndReleaseMouseButton(1)
PressAndReleaseMouseButton(1)
PressAndReleaseMouseButton(1)
Sleep(40)
end
end
  1. 将向左滚动 (G11) 绑定到命令“后退”。
    这将删除“后退”G4 按钮的功能,但中键单击将起作用。
  2. 设置脚本:
function OnEvent(event, arg)
  if event == "MOUSE_BUTTON_PRESSED" and arg == 11 then
    repeat
      PressAndReleaseMouseButton(1)
      PressAndReleaseMouseButton(1)
      PressAndReleaseMouseButton(1)
      PressAndReleaseMouseButton(1)
      Sleep(40)
    until not IsMouseButtonPressed(4)  -- 4 = Back
  end
end