xuhdev
xuhdev

Reputation: 9380

Lua: Toggling the primary click in G Hub doesn't work

My script in G Hub looks like the follows:

function OnEvent(event, arg)
    if (event == "G_PRESSED" and arg == 7) then
        if not IsMouseButtonPressed(1) then
            PressMouseButton(1);
            OutputLCDMessage("Button 1 toggle on.");
        else
            ReleaseMouseButton(1);
            OutputLCDMessage("Button 1 toggle off.");
        end
    end
end

However, it doesn't seem like anything happens when I press G7. Did I do anything wrong?

Upvotes: 0

Views: 7

Answers (0)

Related Questions