罗技鼠标重复与切换

时间:2020-04-12 08:39:04

标签: lua logitech-gaming-software

我已经尝试过并且总是以无限循环结束。

我的代码:

toggle_button = 5
button_toggled = false
function OnEvent(event, arg)
    if event == "MOUSE_BUTTON_PRESSED" and arg == toggle_button then
        button_toggled = not button_toggled
        if button_toggled then
            while button_toggled do
            OutputLogMessage(tostring(button_toggled))
            Sleep(50)
            end
        else
            button_toggled = not button_toggled
        end 
    end
end

0 个答案:

没有答案