Skip to content

Instantly share code, notes, and snippets.

@neo-razgriz
Last active August 6, 2024 04:53
Show Gist options
  • Save neo-razgriz/d627f75331649acbb1061a24690e1d35 to your computer and use it in GitHub Desktop.
Save neo-razgriz/d627f75331649acbb1061a24690e1d35 to your computer and use it in GitHub Desktop.
Zoom PTT for Logitech G HUB
--[[ ZOOM PTT FOR LOGITECH G
PREREQUISITES:
- Logitech G compatible mouse
- Following checkboxes are checked in Zoom preferences:
- Keyboard Shortcuts -> Mute/Unmute My Audio -> Enable Global Shortcut
- Audio -> Mute my mic when joining a meeting
- Audio -> Automaically join computer audio when joining a meeting
INSTALLATION:
1. Open Logitech G HUB
2. Click on the active profile
3. Click on the "Scripting" button under the desired profile
4. Active LUA Script -> + Create a new LUA script
5. Edit script
6. Paste the contents of this file
7. Modify the "key" value to whatever key you want to bind the PTT to.
8. Save and close
HOW DO I KNOW WHICH KEY VALUE TO ENTER?
1. Uncomment (remove the inital "--" from) the line that says "PRINT THE MOUSE KEY VALUES"
2. Save
3. Click the desired mouse key
4. Replace "key=" number with the printed number
5. Comment the line from step 1
6. Save
NOTES:
- The key you choose will still perform its original functionality, so i suggest setting it to "disabled" in G HUB.
- Assumes the initial status is muted.
- Cannot check the actual zoom mute status.
- Uses zoom's default keyboard shortcut for mac (command + shift + a)
- For Windows, change the value of ctrlOrGui to "lctrl" (zoom unmute shortcut is control + shift + a in windows)
KNOWN ISSUE:
- Changing focus to/from the Zoom window while holding down the PTT button will not toggle mute/unmute when PTT is released.
To fix: manually toggle the mute/unmute key combination once. (Ctrl or Cmd + Shift + a)
--]]
isPressed = false;
key=6; -- 6 is DPI Shift on G502
ctrlOrGui = "lgui"; -- Change to "lctrl" for Windows
function PrintKeyValue(event, arg)
if event =="MOUSE_BUTTON_PRESSED" then
OutputLogMessage("%s\n", arg)
end
end
function ToggleMute()
-- "Toggle audio" binding in zoom for mac: lgui (left command) + lshift + a
PressKey(ctrlOrGui);
PressKey("lshift");
PressKey("a");
Sleep(50);
ReleaseKey(ctrlOrGui);
ReleaseKey("lshift");
ReleaseKey("a");
end
function OnEvent(event, arg)
-- PrintKeyValue(event, arg); -- PRINT THE MOUSE KEY VALUES
if arg == key and (
(not isPressed and event =="MOUSE_BUTTON_PRESSED") or
(isPressed and event =="MOUSE_BUTTON_RELEASED")) then
ToggleMute();
isPressed = not isPressed;
end
end
@rajakodumuri
Copy link

Smaller though the subset may be, there are others who're looking for PTT on Zoom, glad I'm not alone. It works perfectly! I made some modifications to fit my requirement. You solved an itch in my brain I couldn't scratch.

THANK YOU!

@neo-razgriz
Copy link
Author

@rajakodumuri Thank you for the feedback! Happy to see other people finding this useful.

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