原正常运行的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
相关产品推荐
相关产品推荐

