【发布时间】:2014-10-30 22:09:45
【问题描述】:
我的罗技 G500 有一个小宏 - 我在 FPS 游戏中使用它来减少后坐力。请参阅下面的脚本:
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
repeat
MoveMouseRelative(-1,2)
Sleep(16)
until not IsMouseButtonPressed(1)
end
end
问题是这个脚本一直在工作。 我希望按下另一个按钮 1 开始在按钮 2 上使用脚本并重新按下按钮 1 以中断脚本
我试图设置以下标志:
unction OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 6 then --set flag for mb1
mb1_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 6 then --set flag for mb1=false
mb1_pressed = false
end
If mb1_pressed then
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 and then
repeat
MoveMouseRelative(-1,2)
Sleep(16)
until not IsMouseButtonPressed(1)
end
end
但它不起作用。你能帮帮我吗?
【问题讨论】:
-
这能回答你的问题吗? LUA scripting switching on/off a script
标签: lua lua-scripting-library logitech-gaming-software