Skip to content

Instantly share code, notes, and snippets.

@jon-heller
Created April 13, 2020 21:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jon-heller/60df6e0d45223ac3f57af2b711c2827b to your computer and use it in GitHub Desktop.
Save jon-heller/60df6e0d45223ac3f57af2b711c2827b to your computer and use it in GitHub Desktop.
Zoom global hotkeys for Windows using AutoHotKey
; A system-wide mute toggle for Zoom Meetings.
$NumpadAdd::
; Zoom appears not to accept ControlSend when in the background, so
; we isolate the Zoom and current windows, switch over to Zoom, send
; its own mute-toggle hotkey, and then switch back.
;
; Get the current window
WinGet, active_window, ID, A
;
; First check if we're sharing our screen and capture the toolbar:
zoom_window := WinExist("ahk_class ZPFloatToolbarClass")
;
; If we aren't sharing our screen, pull the Zoom window:
if (zoom_window = "0x0") {
zoom_window := WinExist("ahk_class ZPContentViewWndClass")
}
;
; Do we know we have a zoom_window? If not, bail.
if (zoom_window = "0x0") {
Send {F9}
return
}
;
; Whichever we have, switch over to it:
WinActivate, ahk_id %zoom_window%
;
; Toggle Mute
Send !a
;
; Go back
;WinActivate ahk_id %active_window%
Return
; A system-wide quit button for Zoom meetings
$NumpadSub::
; Zoom appears not to accept ControlSend when in the background, so
; we isolate the Zoom and current windows, switch over to Zoom, send
; its own mute-toggle hotkey, and then switch back.
;
; Get the current window
WinGet, active_window, ID, A
;
; First check if we're sharing our screen and capture the toolbar:
zoom_window := WinExist("ahk_class ZPFloatToolbarClass")
;
; If we aren't sharing our screen, pull the Zoom window:
if (zoom_window = "0x0") {
zoom_window := WinExist("ahk_class ZPContentViewWndClass")
}
;
; Do we know we have a zoom_window? If not, bail.
if (zoom_window = "0x0") {
Send {F9}
return
}
;
; Whichever we have, switch over to it:
WinActivate, ahk_id %zoom_window%
;
; Send quit command
Send !q
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment