首页 > 解决方案 > 罗技鼠标重复切换

问题描述

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

我的代码:

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

标签: lualogitech-gaming-software

解决方案


推荐阅读