【问题标题】:lua script problem for logitech g512 keyboard罗技 g512 键盘的 lua 脚本问题
【发布时间】:2022-01-07 11:38:46
【问题描述】:

我想在我的罗技 g512 键盘中实现这个由“Egor Skriptunoff”在我以前的线程中发布的 lua 脚本。 Lua script loop keys press

问题是我尝试了一些类似这样的修改,即将 (MOUSE_BUTTON_PRESSED) 替换为 (G_PRESSED),因为我的键盘有 f1-f12 g 键但没有任何作用。有什么解决办法吗?

local keys = {"5", "6", "7"}   -- cycle of keys
local idx = 0
local tm = -math.huge

function OnEvent(event, arg, kb)
if event == "G_PRESSED" and arg == 2 then
      if GetRunningTime() - tm > 1000 then
         idx = 0
      end
      idx = idx % #keys + 1
      PressKey(keys[idx])
   elseif event == "G_RELEASED" and arg == 2 then
      ReleaseKey(keys[idx])
      tm = GetRunningTime()
   end
end

【问题讨论】:

    标签: lua keyboard logitech logitech-gaming-software


    【解决方案1】:

    脚本没问题。
    问题在于 GHUB - 在您将非标准宏绑定到它之前,它不会生成 G 键事件。
    所以,创建一个宏“Press F2 - wait 50 ms - Release F2”并将其分配给GHUB中的G2(以保存键的原始功能)。不要绑定标准的“F2”宏!
    之后你的脚本就可以工作了。

    【讨论】:

    • 非常感谢!也可以将脚本绑定到其他键中,例如“V”字母,还是只绑定到 gkeys?
    • 只有鼠标按钮和键盘 G 键
    猜你喜欢
    • 2021-08-14
    • 2021-04-12
    • 2021-08-13
    • 2020-11-02
    • 2021-04-22
    • 2020-01-26
    • 2021-07-28
    • 2021-08-13
    • 2021-05-27
    相关资源
    最近更新 更多