You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Disabling 'esc to exit fullscreen' shortcut on macOS

The ESC key seems to universally exit fullscreen view. E.g. I have multiple fullscreen 'spaces' with a window occupying each. One of these is a browser. Pressing ESC at any time during my browsing session causes the whole fullscreen space to be exited. I can't find a way to disable this in System Preferences. It's very frustrating.


MacBook Pro 14″

Posted on Jul 24, 2023 3:13 AM

Reply
Question marked as Top-ranking reply

Posted on Jul 24, 2023 5:01 AM

You can't do what you want. It's baked into the OS. You're welcome.

23 replies

Jul 24, 2023 4:30 AM in response to danielw97

As the User ( daniel97 ) has marked one of the above replies as Best Answer a few things generally occur.


1 - This would indicate to Other Contributors that the Original question is solved and no further assistance is needed .


2 - This could also effectively cut off other Contributors from offering additional insights or explanations


To get a more full understanding on how the Apple Support Community Forums function.


Suggest taking the time to explore the information in below link


How to use Apple Support Communities




Mar 15, 2024 6:25 PM in response to danielw97

Here is what ChatGPT told me, asking it how to use Karanbiner to solve this. It works for me (yay yay finally!!!)


---


To prevent the "Esc" key from causing Safari to exit full-screen mode using Karabiner-Elements on a Mac, you'll directly create a custom configuration. Here's how you can set it up:


### Step 1: Install Karabiner-Elements


### Step 2: Open Karabiner-Elements


Launch Karabiner-Elements from your Applications folder or via Spotlight search.


### Step 3: Navigate to the Configuration File


Since there's no community rule for this specific need, you'll edit the configuration file (`karabiner.json`) directly:


- This file is located at `~/.config/karabiner/`.

- Open `karabiner.json` in your preferred text editor.


### Step 4: Add Your Custom Rule


You're going to add a custom rule to this JSON file. Look for the `profiles` section, and within your current profile, find the `rules` array to add a new rule.


Add the following JSON snippet as a new element in the `rules` array. This rule effectively disables the "Esc" key in Safari by remapping it to do nothing when Safari is the frontmost application:


```json

{

"title": "Custom Modifications",

"rules": [

{

"description": "Disable Esc in Safari to prevent exiting full-screen",

"manipulators": [

{

"type": "basic",

"from": {

"key_code": "escape",

"modifiers": {

"optional": ["any"]

}

},

"to": [

{

"key_code": "vk_none"

}

],

"conditions": [

{

"type": "frontmost_application_if",

"bundle_identifiers": ["^com.apple.Safari$"]

}

]

}

]

}

]

}

```


### Step 5: Save and Apply Changes


After adding the rule to your `karabiner.json` file, save the changes. Karabiner-Elements should automatically detect the update and apply the new configuration. If it doesn't, you might need to restart Karabiner-Elements.


### Important Notes:


- This solution specifically targets disabling the "Esc" key within Safari. It's a direct approach to your request, designed to prevent Safari from exiting full-screen mode when "Esc" is pressed.

- Given the specific nature of this modification, it's unlikely to have unintended side effects outside of Safari. However, be mindful of any scenarios where you might need the "Esc" key to function normally within Safari.

- Always back up your `karabiner.json` file before making modifications, allowing you to revert to your original settings if needed.


This method offers a targeted solution for your issue with Safari and full-screen mode. Should you encounter unexpected behavior or need further customizations, you might need to adjust the rule accordingly.


[Edited by Moderator]



Disabling 'esc to exit fullscreen' shortcut on macOS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.