Skip to content

Instantly share code, notes, and snippets.

@jon-heller

jon-heller/Zoom.ahk

Created Apr 13, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.