Skip to content

Instantly share code, notes, and snippets.

@MartinHarding
Last active October 28, 2023 10:35
Show Gist options
  • Save MartinHarding/3155be5e286e3f483223a1e21024c554 to your computer and use it in GitHub Desktop.
Save MartinHarding/3155be5e286e3f483223a1e21024c554 to your computer and use it in GitHub Desktop.
Logitech Gaming Software Mouse Button Toggle script
-- Toggles a mouse button when you press another mouse button.
-- 1. Change your mouse to "Automatic Game Detection" mode
-- 2. Right click on a profile's icon and choose scripting
-- 3. Paste this into the default profile script box, save, enjoy!
toggle_button = 7 -- What mouse button should control the toggle
button_to_toggle = 1 -- What button to toggle
button_toggled = false
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == toggle_button then
button_toggled = not button_toggled
OutputLogMessage("Mouse %d toggled %s", button_to_toggle, tostring(button_toggled))
if button_toggled then
PressMouseButton(button_to_toggle)
else
ReleaseMouseButton(button_to_toggle)
end
end
end
@evanricard
Copy link

Is there any way to apply this profile to a Logitech Ergo MX?

Copy link

ghost commented Jun 7, 2021

https://github.com/RavenBHK/DBD-Left-Hold-and-Auto-Run

I used to above macro and am trying to combine with this one. Can anyone help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment