【发布时间】:2021-09-06 13:14:06
【问题描述】:
我一直在尝试制作一个像这样工作的脚本
使用滚动锁定启用
按住空格 = 每 20 毫秒按空格
我将 G3 键用作空格的占位符,因为我不知道如何执行 if PressKey("space") 类型的操作
这就是我目前所拥有的
function OnEvent(event, arg)
if (event == "G_PRESSED" and arg == 3) and IsKeyLockOn("scrolllock") then
PressKey("spacebar")
sleep(20)
ReleaseKey("spacebar")
repeat
until not (event == "G_PRESSED" and arg == 3)
end
end
【问题讨论】:
-
我不熟悉 Lua,但我认为你的
repeat语法是错误的。文档说它是repeat \n (statement) \n until (condition): lua.org/pil/4.3.3.html 但你有repeat \n until (condition )。 -
repeat until condition是正确的 Lua 语句。
标签: lua logitech logitech-gaming-software