Attention: Here be dragons

This is thelatest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Checking the stable version of the documentation...

EditorCommandPalette

Inherits:ConfirmationDialog<AcceptDialog<Window<Viewport<Node<Object

Godot editor's command palette.

Description

Object that holds all the available Commands and their shortcuts text. These Commands can be accessed throughEditor > Command Palette menu.

Command key names use slash delimiters to distinguish sections, for example:"example/command1" thenexample will be the section name.

varcommand_palette=EditorInterface.get_command_palette()# external_command is a function that will be called with the command is executed.varcommand_callable=Callable(self,"external_command").bind(arguments)command_palette.add_command("command","test/command",command_callable)

Note: This class shouldn't be instantiated directly. Instead, access the singleton usingEditorInterface.get_command_palette().

Properties

bool

dialog_hide_on_ok

false (overridesAcceptDialog)

Methods

void

add_command(command_name:String, key_name:String, binded_callable:Callable, shortcut_text:String = "None")

void

remove_command(key_name:String)


Method Descriptions

voidadd_command(command_name:String, key_name:String, binded_callable:Callable, shortcut_text:String = "None")🔗

Adds a custom command to EditorCommandPalette.

  • command_name:String (Name of theCommand. This is displayed to the user.)

  • key_name:String (Name of the key for a particularCommand. This is used to uniquely identify theCommand.)

  • binded_callable:Callable (Callable of theCommand. This will be executed when theCommand is selected.)

  • shortcut_text:String (Shortcut text of theCommand if available.)


voidremove_command(key_name:String)🔗

Removes the custom command from EditorCommandPalette.

  • key_name:String (Name of the key for a particularCommand.)


User-contributed notes

Please read theUser-contributed notes policy before submitting a comment.