Skip to content

Instantly share code, notes, and snippets.

@rohanrhu
Created January 23, 2018 16:52
Show Gist options
  • Save rohanrhu/8e1f625c92877b9c20bf776181e1e600 to your computer and use it in GitHub Desktop.
Save rohanrhu/8e1f625c92877b9c20bf776181e1e600 to your computer and use it in GitHub Desktop.
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