Skip to content

Add support for closing dialog windows with Cmd+W on macOS - #107303

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
passivestar:close-dialog-action
Oct 22, 2025
Merged

Add support for closing dialog windows with Cmd+W on macOS#107303
Repiteo merged 1 commit into
godotengine:masterfrom
passivestar:close-dialog-action

Conversation

@passivestar

@passivestar passivestar commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

Adds a new ui_close_dialog action to allow support for Cmd+W on macOS. dialog_close_on_escape property is kept unchanged. Closes godotengine/godot-proposals#9311, closes #86200

@bruvzg bruvzg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cmd + W is a standard macOS shortcut, and separate ui_close_dialog make sense. As long as it's not conflicting with anything (seems like it's not, the same shortcut is already used to close scene/script editor) it should be fine.

@passivestar

Copy link
Copy Markdown
Contributor Author

Removed the unnecessary display name override as per #107487

@bruvzg bruvzg modified the milestones: 4.x, 4.6 Oct 22, 2025
Comment thread core/input/input_map.cpp
Comment on lines +455 to +458
inputs = List<Ref<InputEvent>>();
inputs.push_back(InputEventKey::create_reference(Key::W | KeyModifierMask::META));
inputs.push_back(InputEventKey::create_reference(Key::ESCAPE));
default_builtin_cache.insert("ui_close_dialog.macos", inputs);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that escape and cmd w both do the same thing in some situations? I don't think that would be standard macOS behavior.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not, but ESC is the current key for closing dialogs, so no reason to remove it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that makes sense.

@Ivorforce Ivorforce left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@Repiteo
Repiteo merged commit 38e2033 into godotengine:master Oct 22, 2025
20 checks passed
@Repiteo

Repiteo commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Thanks!

@passivestar
passivestar deleted the close-dialog-action branch October 22, 2025 19:14
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
…ction

Add support for closing dialog windows with Cmd+W on macOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Command+W for closing dialog windows on macOS Cmd-W shortcut not working in Editor

5 participants