Instantly share code, notes, and snippets.

Embed
What would you like to do?
EnablePrimaryMouseButtonEvents(true);
function OnEvent(event, arg)
if arg == 1 then
color = 0
repeat
if color == 0 then
SetBacklightColor(255,0,0, "mouse")
color = 1
else
SetBacklightColor(0,0,255, "mouse")
SetBacklightColor(0,0,0, "mouse")
Sleep(33);
SetBacklightColor(0,0,255, "mouse")
color = 0
end
Sleep(33)
until not IsMouseButtonPressed(1)
if (arg == 1) and (event == "MOUSE_BUTTON_RELEASED") then
SetBacklightColor(255,0,0, "mouse")
end
end
if arg == 2 then
color = 0
repeat
if color == 0 then
SetBacklightColor(255,0,0, "mouse")
color = 1
else
SetBacklightColor(0,255,0, "mouse")
SetBacklightColor(0,0,0, "mouse")
Sleep(33);
SetBacklightColor(0,255,0, "mouse")
color = 0
end
Sleep(33)
until not IsMouseButtonPressed(3)
if (arg == 2) and (event == "MOUSE_BUTTON_RELEASED") then
SetBacklightColor(255,0,0, "mouse")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment