Skip to content

Components

Shortcut

A keybinding attached to the control it fires. Names either a rebindable action, so a rebind moves the key with it, or a literal chord like Ctrl+S for one that never changes.

On this page

Add it

+ Add node → Menu Button creates a node with it already on. Already have a node for it? Add component → ShortcutComponent.

From a script

A script on the same node writes these fields by name. ShortcutComponent is the name to pass.

rgs
set_text("ShortcutComponent", "action", "");
set_text("ShortcutComponent", "key", "");
set_flag("ShortcutComponent", "show_label", true);

Fields

FieldScript nameKindDefaultWhat it does
ActionactiontextemptyInput action that fires this widget.
KeykeytextemptyA key named literally, e.g. Ctrl+KeyS.
Show Labelshow_labelcheckboxonWhether the control draws its key inside its right edge, at half the size of its words.