Logitech G402
script:
EnablePrimaryMouseButtonEvents (true)
function OnEvent(event, arg, family)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
click = 0
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 6) then
recoil = not recoil
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
click = 1
Click()
end
if (event == "M_RELEASED" and arg == 3) then
Click()
end
if (event == "MOUSE_BUTTON_RELEASED" and arg == 1) then
Stopclick()
end
end
function Click()
PressAndReleaseMouseButton(1)
Sleep (8.3)
MoveMouseRelative(0, 2)
if click == 0 then
Stopclick()
elseif click == 1 then SetMKeyState(3)
else Stopclick()
end
end
function Stopclick()
click = 0
end
|