4

In Zoom Screen Sharing, there is a "meeting controls" window by default, which can get in the way. It is possible to hide it with the ⌘ Command^ Control⌥ OptionH keyboard shortcut, which is nice.

However, if you press the Esc key at any time during the screen share (for example, to stop editing in Vim, or un-focus an input field in a web form), Zoom will show the meeting controls again and steal window focus, which is quite disruptive.

Zoom does not seem to offer any settings to disable this behavior. Relevant Zoom community forum post here: How can I disable Escape key binding in Zoom?

Is there a way to prevent this, perhaps with a tool like Karabiner-Elements?

I think what I want to do is prevent Zoom from listening to the Esc key when I am focused on other windows.

3 Answers 3

3

I was able to solve this by using Hammerspoon to move the window offscreen.

In daily usage, I press ctrloptshiftH to toggle the meeting controls between the top of the screen off the screen entirely.

This makes it easy to get the meeting controls out of the way, with no esc interference.

Steps:

  1. (Optional). If you want to use the same hotkey, go into Zoom Settings (⌘ Command,), press "Keyboard Shortcuts" on the left", and scroll down to "Show/Hide Floating Meeting Controls" near the bottom, and clear the shortcut so it says "Not set".
  2. Download & install Hammerspoon (I ran brew install hammerspoon in the Terminal). Open the application.
  3. Add the following to ~/.hammerspoon/init.lua:
local originalFrame = nil

hs.hotkey.bind({"cmd", "ctrl", "alt"}, "H", function()
  local zoomWindow = hs.window.find("zoom share statusbar window")
  if zoomWindow then
    if originalFrame then
      zoomWindow:setFrame(originalFrame)
      originalFrame = nil
    else
      originalFrame = zoomWindow:frame()
      local screen = zoomWindow:screen()
      local frame = zoomWindow:frame()
      frame.x = screen:frame().w + 3000
      frame.y = screen:frame().h + 3000
      zoomWindow:setFrame(frame)
    end
  end
end)

To do this, you can open the Terminal application from Spotlight (cmd+space) and then run touch ~/.hammerspoon/init.lua and then open -A Textedit ~/.hammerspoon/init.lua and paste the above script in to the window, save it, and close it.

  1. Restart Hammerspoon, and you're good to go – pressing ⌘ Command^ Control⌥ OptionH will now move the meeting controls offscreen, and pressing it again will move them back to where they were.

Credits:

  1. User whatever1 in this post on the Zoom forum who suggested using BetterTouchTool for this and mentioned the name of the window (thank you!).
  2. ChatGPT, the author of ~all the above Lua code (I made a few tweaks).
1
  • 1
    Thank you! This so far is the best workaround.
    – juancn
    Commented Feb 8, 2023 at 16:38
1

You can't prevent an app (Zoom in this case) from listening to a key press. All applications are allowed to listen to and for key press events and act accordingly.

It's also important to note that the Zoom developers aren't really doing anything "wrong". Per the macOS Human Interface Guidelines, universal keys and shortcuts (i.e. ⌘ CommandC/V for cut/paste) should be respected. However, nothing is assigned to the Esc when pressed in isolation - that makes it fair game.

That said, it is probably a good idea to share feedback with Zoom as screen sharing is a valuable tool and it doesn't play well with other apps that use Esc for their own functions.

There are two potential workarounds:

  • Use hidutil to remap the Esc to something else. The downside to this is it is system wide meaning it will be remapped for every app. This is probably something you don't want to do.

  • Use a 3rd party App like USB Overdrive ($20USD). This is a key remapping utility similar to ControllerMate (described in detail below). I've not tested this, but it should accomplish the same thing as CM. YMMV.

  • ControllerMate. It's free for a small number of building blocks, so for a single key like this you should be okay. I personally use this to create a "macro-board" for apps like Photoshop Lightroom and Think-or-Swim. You can create programming pages that only apply to specific applications - in your case, Zoom.

    ControllerMate Properties Inspector - Zoom

    This second image is of the "Page Programming sheet" that allows you create "building blocks" of actions. Here I have intercepted the Esc and set it to output a system beep.

    enter image description here

When I tested in Zoom, it seemed to work, but I didn't have a live Zoom call to to try it out on to see if that had any bearing on it's functionality.

2
  • Thanks… I'm struggling to understand, with ControllerMate, how would I tell it to ignore the Esc key? (Note that the behavior is most vexing when Zoom is not the foreground window).
    – rattray
    Commented Jan 30, 2023 at 2:22
  • BTW, if you'd like to repro, you can boot up an empty Zoom meeting with no participants and still share your screen. This will show the meeting controls ("mute", "stop video", etc)
    – rattray
    Commented Jan 30, 2023 at 2:23
1

If you're on a mac and don't want to install any additional tools, you could use this Applescript (inspired by ChatGPT):

tell application "System Events"
    set targetAppName to "zoom.us"
    set toolBarWindowName to "zoom share toolbar window"
    set statusBarWindowName to "zoom share statusbar window"
    
    if (get name of every application process) contains targetAppName then
        tell process targetAppName
            
            -- Get the list of windows for the target application
            set targetWindows to every window
            
            set toolBarWindow to ""
            set statusBarWindow to ""
            
            -- Find the window by its name
            repeat with targetWindow in targetWindows
                if name of targetWindow is statusBarWindowName then
                    set statusBarWindow to targetWindow
                else if name of targetWindow is toolBarWindowName then
                    set toolBarWindow to targetWindow
                end if
            end repeat
            
            if toolBarWindow is not "" then
                set {statusBarX, statusBarY} to position of statusBarWindow
                set {statusBarWidth, statusBarHeight} to size of statusBarWindow
                
                set {toolBarX, toolBarY} to position of toolBarWindow
                set {toolBarWidth, toolBarHeight} to size of toolBarWindow
                
                if toolBarY ≥ 0 then
                    -- Move the window outside the screen area
                    set position of toolBarWindow to {toolBarX, -toolBarHeight}
                    set position of statusBarWindow to {statusBarX, -statusBarHeight}
                else
                    -- Show window
                    set position of statusBarWindow to {statusBarX, toolBarHeight}
                    set position of toolBarWindow to {toolBarX, 0}
                end if
            end if
        end tell
    end if
    
end tell

You can then assign it a keyboard shortcut using Automator's "quick action", the Shortcut.app or Alfred, see more here

Hint: you could use the same ⌘ Command^ Control⌥ OptionH shortcut, but you need to disable it in Zoom's preferences first, as @rattray mentioned in his comment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .