diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index 168fe5a7ace9..18a251a306b7 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -357,3 +357,13 @@ Ref ED_SHORTCUT_AND_COMMAND(const String &p_path, const String &p_name EditorCommandPalette::get_singleton()->add_shortcut_command(p_command_name, p_path, shortcut); return shortcut; } + +Ref ED_SHORTCUT_ARRAY_AND_COMMAND(const String &p_path, const String &p_name, const PackedInt32Array &p_keycodes, String p_command_name) { + if (p_command_name.is_empty()) { + p_command_name = p_name; + } + + Ref shortcut = ED_SHORTCUT_ARRAY(p_path, p_name, p_keycodes); + EditorCommandPalette::get_singleton()->add_shortcut_command(p_command_name, p_path, shortcut); + return shortcut; +} diff --git a/editor/editor_command_palette.h b/editor/editor_command_palette.h index 7eb9ff740456..b34c4ddf971c 100644 --- a/editor/editor_command_palette.h +++ b/editor/editor_command_palette.h @@ -105,5 +105,6 @@ class EditorCommandPalette : public ConfirmationDialog { }; Ref ED_SHORTCUT_AND_COMMAND(const String &p_path, const String &p_name, Key p_keycode = Key::NONE, String p_command = ""); +Ref ED_SHORTCUT_ARRAY_AND_COMMAND(const String &p_path, const String &p_name, const PackedInt32Array &p_keycodes, String p_command = ""); #endif // EDITOR_COMMAND_PALETTE_H diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 5341d73fe438..223e50f557fd 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -7226,8 +7226,8 @@ EditorNode::EditorNode() { file_menu->add_separator(); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open", TTR("Quick Open..."), KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::O), FILE_QUICK_OPEN); - ED_SHORTCUT_OVERRIDE("editor/quick_open", "macos", KeyModifierMask::META + KeyModifierMask::CTRL + Key::O); + file_menu->add_shortcut(ED_SHORTCUT_ARRAY_AND_COMMAND("editor/quick_open", TTR("Quick Open..."), { int32_t(KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::O), int32_t(KeyModifierMask::CMD_OR_CTRL + Key::P) }), FILE_QUICK_OPEN); + ED_SHORTCUT_OVERRIDE_ARRAY("editor/quick_open", "macos", { int32_t(KeyModifierMask::META + KeyModifierMask::CTRL + Key::O), int32_t(KeyModifierMask::CMD_OR_CTRL + Key::P) }); file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open_scene", TTR("Quick Open Scene..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::O), FILE_QUICK_OPEN_SCENE); file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open_script", TTR("Quick Open Script..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::ALT + Key::O), FILE_QUICK_OPEN_SCRIPT);