:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ShortCut.xml. .. _class_ShortCut: ShortCut ======== **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` A shortcut for binding input. .. rst-class:: classref-introduction-group Description ----------- A shortcut for binding input. Shortcuts are commonly used for interacting with a :ref:`Control` element from a :ref:`InputEvent`. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------------+---------------------------------------------------+ | :ref:`InputEvent` | :ref:`shortcut` | +-------------------------------------+---------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_as_text` **(** **)** |const| | +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_shortcut` **(** :ref:`InputEvent` event **)** |const| | +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_valid` **(** **)** |const| | +-----------------------------+---------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_ShortCut_property_shortcut: .. rst-class:: classref-property :ref:`InputEvent` **shortcut** .. rst-class:: classref-property-setget - void **set_shortcut** **(** :ref:`InputEvent` value **)** - :ref:`InputEvent` **get_shortcut** **(** **)** The shortcut's :ref:`InputEvent`. Generally the :ref:`InputEvent` is a keyboard key, though it can be any :ref:`InputEvent`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_ShortCut_method_get_as_text: .. rst-class:: classref-method :ref:`String` **get_as_text** **(** **)** |const| Returns the shortcut's :ref:`InputEvent` as a :ref:`String`. .. rst-class:: classref-item-separator ---- .. _class_ShortCut_method_is_shortcut: .. rst-class:: classref-method :ref:`bool` **is_shortcut** **(** :ref:`InputEvent` event **)** |const| Returns ``true`` if the shortcut's :ref:`InputEvent` equals ``event``. .. rst-class:: classref-item-separator ---- .. _class_ShortCut_method_is_valid: .. rst-class:: classref-method :ref:`bool` **is_valid** **(** **)** |const| If ``true``, this shortcut is valid. .. |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.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`