Run Logitech G Hub as Administrator
Hotkeys : G9 Active
G9 Deactive
Code:
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 9) then
recoilx4 = not recoilx4
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoilx4) then
if recoilx4 then
repeat
Sleep(3)
MoveMouseRelative(0, 6)
Sleep(3)
MoveMouseRelative(0, -6)
until not IsMouseButtonPressed(1)
end
end
end
https://streamable.com/lfzwkk