Some apps (Safari, iTunes...) quits fullscreen mode on Esc keyboard shortcut. Is there a way to disable it? It interferes e. g. with web apps control resulting in unintentional quitting fullscreen when you just hit one more Escape than you should.
6 Answers
It is way easier - in Firefox:
- In the URL bar write "about:config"
- Agree with security risks
- Search for "escape", it should find the entry browser.fullscreen.exit_on_escape
- Double click on "true", it should go to "false"
-
6Firefox FTW!!! <3 <3 – radiantRazor Nov 09 '21 at 05:27
-
2This is the correct answer for Firefox. It is Firefox-specific, but it does solve the actual Esc problem. Setting a shortcut in the normal MacOS keyboard settings does not. – alexykot Nov 09 '21 at 08:01
-
No such entry exists in Firefox 113 – ivanjermakov Jun 02 '23 at 12:15
-
@ivanjermakov firefox 120 dev edition. entry exists, works perfectly. – seeker_of_bacon Nov 07 '23 at 18:16
Good question. Before browser makers figured out cmd-q was awfully dangerous without at least a prompt that the user really wants to close 60 tabs, I always changed the keyboard shortcut for the Quit command on my main browser. You can disable shortcuts via Keyboard Shortcuts.
- Open System Preferences: Keyboard.
- Click Keyboard Shortcuts in the top pill shaped tab.
- Click the Applications Shortcuts icon in the left hand column.
- Choose Safari from the drop down menu of offered applications (looks like the default list is applications which have been opened in the last three months).

- Enter the exact name of the menu item you wish to disable. In this case "Exit Full Screen".
- Add an alternative keyboard shortcut (in this illustration, I added
Ctrl-Opt-Cmd-c)
This is what the finished result looks like.

- Test (alternative Application Shortcuts do now always work exactly as planned).
You can do the same thing with Keyboard Maestro (and much much more). Apple's feature is probably taken/adopted from Peter N. Lewis's implementation (which existed for many years before Apple came up with the feature in Snow Leopard). In Keyboard Maestro, you can also assign the same shortcut to multiple applications. In Keyboard Maestro, you can also take over keyboard commands which do not have menu items (complex applications like Photoshop come to mind: there are so many commands that many of the commands have no menu equivalent). It's also easier to move these preferences around from computer to computer if you are using Keyboard Maestro.
On the other hand the Apple version exists on all Macs past 10.6.8, including your less technical girlfriend's MacBook Pro. I use both depending on whether I want a quick fix or if I'm building permanent tools/shortcuts for an application I use professionally on multiple computers. Keyboard Maestro does far more than just substitute keyboard shortcuts: you can write sequential macros with pauses to automate what would otherwise be five or ten keypress and click type actions, i.e. redirecting, address and send email to someone else in the company with a single keyboard command.
- 1,041
-
18This is how to set an alternative shortcut, but how to disable a native one? Do I miss something? – HoursFrom.World Apr 05 '16 at 20:22
-
Normally, the Keyboard Maestro manually set shortcut will take precedence over the native one. If you find that's not the case, let me know. Sorry for the slow answer. – Foliovision Apr 15 '16 at 20:22
-
Overriding a native command as built-in as deeply as command-Q is the most reliable way to disable it. – Foliovision Jul 08 '17 at 15:47
-
12The problem here is that the native shortcut by default is Ctrl-Cmd-F. Overriding the "Exit Full Screen" menu will only override the Ctrl-Cmd-F but ESC seems to have been implemented separately without a menu item ... :/ – Theuni Feb 01 '19 at 11:25
-
8
-
Here's an actual way to disable even a built-in keyboard shortcut (such as
Cmd+Q): https://forums.macrumors.com/threads/disable-cmd-q-in-firefox.752904/?post=8158516#post-8158516 – GDP2 Aug 19 '20 at 02:08 -
77 years and apple still doesn't have a native solution for this. Shame and annoying. – End-2-End Feb 09 '21 at 07:11
Oh, finally I did it!
Using Better Touch Tool app (but I think other such apps might work as well).
Added a custom keyboard shortcut ⎋Escape for Final Cut Pro which does nothing.
As a drawback, you won't be able to do useful things with Escape key (i.e. closing Preferences window).
- 261
When it comes to Safari, then for macOS 12.3, Safari 15.4 and Tampermonkey 4.17.6162 ($2 in App Store), this script (based on https://superuser.com/a/388993/620906) works for most websites:
// ==UserScript==
// @name Keep Full Screen
// @namespace http://superuser.com/q/315949
// @description Prevents Escape key from leaving full screen.
// @include https://*
// @include http://*
// ==/UserScript==
document.onkeydown = function (evt) {
if (evt.keyCode == 27) evt.preventDefault();
}
And you can usually still use Esc to close modals!
- 131
UPDATE 8/24/23: This still works, but instead of "Shift + ESC" use "Ctrl + ESC", because Apple in their infinite wisdom updated the "exit fullscreen mode" keyboard shortcut to include "Shift + ESC" ♂️ I tested "Ctrl + ESC" for several of my common uses of ESC in the browser (like dismissing autofill suggestions in a text field, or exiting an in-page search, etc.) and they all seem to work as well as "Shift + ESC" used to.
If you use BetterTouchTool (which is amazing, and everyone should use it), I found a really easy trick which works for Safari, and should work for any other browser too. Do the following:
- Create a new app-specific keyboard shortcut in BTT for your preferred web browser
- Set "ESC" as the trigger key, and set "Shift + ESC" as the assigned action.
Shift + ESC seems to cause exactly the same behavior as ESC for everything I use ESC for in the web browser (like removing focus from a text box, or exiting an in-page text search), but Shift + ESC does not trigger full-screen mode exit for the browser window, so the resulting behavior is exactly what I want!
Hope that helps!
- 21
-
1It looks like Shift + ESC also exits fullscreen nowadays. For f's sake Apple! How a company can be so deaf? – Halil Sen Aug 08 '23 at 11:05
-
1Good catch! I ran into the same thing recently, and changed my shortcut (mentioned in my UPDATE edit above). I'd forgotten I wrote this answer, so thanks for flagging it! – lstarrett Aug 24 '23 at 15:44
To avoid the situation when the whole app quits fullscreen mode when you accidentally hit ESC twice you can learn to use a different key.
Cmd-. will quit web apps that are in fullscreen (e.g. YouTube) but will not perform any undesirable actions when used twice.

