Skip to content

Instantly share code, notes, and snippets.

@Virakal
Created February 23, 2023 06:07
Show Gist options
  • Save Virakal/bfd6d8405364590822da8de79e33a856 to your computer and use it in GitHub Desktop.
Save Virakal/bfd6d8405364590822da8de79e33a856 to your computer and use it in GitHub Desktop.
Logitech Script: ToggleLMB when button is clicked
-- When this button is pressed, holdButton will be toggled on or off
local toggleButton = 6
-- When toggleButton is pressed, this button will be toggled on or off
local holdButton = 1
local isPressing = false
function OnEvent(event, arg, family)
if event == "MOUSE_BUTTON_RELEASED" and arg == toggleButton and not IsKeyLockOn("scrolllock") then
if isPressing then
ReleaseMouseButton(holdButton)
else
PressMouseButton(holdButton)
end
isPressing = not isPressing
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment