I'm trying to make a script so that when I press a key the loop starts and when I release it the loop ends.
However, the loop keeps running infinitely, even when I release the key.
function OnEvent(event, arg)
if (event == "G_PRESSED" and arg == 1) then
repeat
OutputLogMessage("Loop")
if (event == "G_RELEASED" and arg == 1) then break end
until (event == "G_RELEASED" and arg == 1)
OutputLogMessage("End Loop")
end
end
("Back" is the default action for mouse button 4).