Logitech LUA脚本:当我按下另一个键时,关闭脚本中的一个键

时间:2020-04-27 19:32:17

标签: lua scripting logitech logitech-gaming-software

我有一个脚本,可以使用F1打开/关闭,并且F2,F3,F4等具有与它们不同的代码。当我按下鼠标左键时,每个代码都会运行。


    if (event == "G_PRESSED" and arg == 1) then
    start = not start
    end

    if (event == "G_PRESSED" and arg == 2) then
    code 1 = not code 1
    end

    if (event == "G_PRESSED" and arg == 3) then
    code 2 = not code 2
    end

    if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and start) then
    if code 1 then
    repeat

    action 1

    until not IsMouseButtonPressed(1)
    end
    end


    if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and start) then
    if code 2 then
    repeat

    action 2

    until not IsMouseButtonPressed(1)

(请注意,代码1 /代码2 /动作1 /动作2不是实际的代码)

但是,如果我按F1和F2,这两个代码将同时运行。有什么方法可以使如果按下F1来关闭F2,F3,F4?如果我按F2键,其他的将被关闭?

0 个答案:

没有答案
相关问题