You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

原正常运行的Ghub Lua脚本突然失效,Ghub/Lua是否有更新?

Logitech G Hub Lua脚本失效问题排查与解决

我有一段Lua脚本在五月份还能正常运行,时隔数月后测试发现完全无法工作,怀疑是G Hub或Lua的更新导致了这个问题。

原脚本代码如下:

function OnEvent(event, arg)
  OutputLogMessage("event = %s, arg = %d\n", event, arg)
  if (event == "PROFILE_ACTIVATED") then
    EnablePrimaryMouseButtonEvents(true)
  elseif event == "PROFILE_DEACTIVATED" then
    ReleaseMouseButton(2) -- to prevent it from being stuck on
  end
  if (event == "MOUSE_BUTTON_PRESSED" and arg == 7) then
    recoil = not recoil
  end
  if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
    if recoil then
      repeat
        Sleep(18)
        MoveMouseRelative(0,2)
      until not IsMouseButtonPressed(1)
    end
  end
end

我多次重装Logitech G Hub并重启设备,但问题仍未解决。

编辑补充:在脚本顶部添加以下代码后,问题得以解决:

EnablePrimaryMouseButtonEvents(true);

内容的提问来源于stack exchange,提问作者asundrus

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 03:01:02