X Tutup
Skip to content

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

Merged
Repiteo merged 1 commit intogodotengine: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 intogodotengine:masterfrom
passivestar:close-dialog-action

Conversation

@passivestar
Copy link
Contributor

@passivestar passivestar commented Jun 9, 2025

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

Copy link
Member

@bruvzg bruvzg left a comment

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
Contributor Author

Removed the unnecessary display name override as per #107487

@bruvzg bruvzg modified the milestones: 4.x, 4.6 Oct 22, 2025
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
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
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
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.

Copy link
Member

@Ivorforce Ivorforce left a comment

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
Copy link
Contributor

Repiteo commented Oct 22, 2025

Thanks!

@passivestar passivestar deleted the close-dialog-action branch October 22, 2025 19:14
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

X Tutup