:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the EditorCommandPalette.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_EditorCommandPalette: EditorCommandPalette ==================== **Inherits:** :ref:`ConfirmationDialog` **<** :ref:`AcceptDialog` **<** :ref:`Window` **<** :ref:`Viewport` **<** :ref:`Node` **<** :ref:`Object` Godot editor's command palette. Description ----------- Object that holds all the available Commands and their shortcuts text. These Commands can be accessed through **Editor > Command Palette** menu. Command key names use slash delimiters to distinguish sections Example: ``"example/command1"`` then ``example`` will be the section name. .. tabs:: .. code-tab:: gdscript var command_palette = get_editor_interface().get_command_palette() # external_command is a function that will be called with the command is executed. var command_callable = Callable(self, "external_command").bind(arguments) command_palette.add_command("command", "test/command",command_callable) .. code-tab:: csharp EditorCommandPalette commandPalette = GetEditorInterface().GetCommandPalette(); // ExternalCommand is a function that will be called with the command is executed. Callable commandCallable = new Callable(this, nameof(ExternalCommand)); commandPalette.AddCommand("command", "test/command", commandCallable) \ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_command_palette`. Properties ---------- +-------------------------+-------------------+------------------------------------------------------------------------------------------+ | :ref:`bool` | dialog_hide_on_ok | ``false`` (overrides :ref:`AcceptDialog`) | +-------------------------+-------------------+------------------------------------------------------------------------------------------+ Methods ------- +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_command` **(** :ref:`String` command_name, :ref:`String` key_name, :ref:`Callable` binded_callable, :ref:`String` shortcut_text="None" **)** | +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_command` **(** :ref:`String` key_name **)** | +------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_EditorCommandPalette_method_add_command: - void **add_command** **(** :ref:`String` command_name, :ref:`String` key_name, :ref:`Callable` binded_callable, :ref:`String` shortcut_text="None" **)** Adds a custom command to EditorCommandPalette. - ``command_name``: :ref:`String` (Name of the **Command**. This is displayed to the user.) - ``key_name``: :ref:`String` (Name of the key for a particular **Command**. This is used to uniquely identify the **Command**.) - ``binded_callable``: :ref:`Callable` (Callable of the **Command**. This will be executed when the **Command** is selected.) - ``shortcut_text``: :ref:`String` (Shortcut text of the **Command** if available.) ---- .. _class_EditorCommandPalette_method_remove_command: - void **remove_command** **(** :ref:`String` key_name **)** Removes the custom command from EditorCommandPalette. - ``key_name``: :ref:`String` (Name of the key for a particular **Command**.) .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`