class_shortcut.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ShortCut.xml.
  6. .. _class_ShortCut:
  7. ShortCut
  8. ========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. A shortcut for binding input.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A shortcut for binding input.
  15. Shortcuts are commonly used for interacting with a :ref:`Control<class_Control>` element from a :ref:`InputEvent<class_InputEvent>`.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------------+---------------------------------------------------+
  22. | :ref:`InputEvent<class_InputEvent>` | :ref:`shortcut<class_ShortCut_property_shortcut>` |
  23. +-------------------------------------+---------------------------------------------------+
  24. .. rst-class:: classref-reftable-group
  25. Methods
  26. -------
  27. .. table::
  28. :widths: auto
  29. +-----------------------------+---------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`String<class_String>` | :ref:`get_as_text<class_ShortCut_method_get_as_text>` **(** **)** |const| |
  31. +-----------------------------+---------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`is_shortcut<class_ShortCut_method_is_shortcut>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |const| |
  33. +-----------------------------+---------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`is_valid<class_ShortCut_method_is_valid>` **(** **)** |const| |
  35. +-----------------------------+---------------------------------------------------------------------------------------------------------------------+
  36. .. rst-class:: classref-section-separator
  37. ----
  38. .. rst-class:: classref-descriptions-group
  39. Property Descriptions
  40. ---------------------
  41. .. _class_ShortCut_property_shortcut:
  42. .. rst-class:: classref-property
  43. :ref:`InputEvent<class_InputEvent>` **shortcut**
  44. .. rst-class:: classref-property-setget
  45. - void **set_shortcut** **(** :ref:`InputEvent<class_InputEvent>` value **)**
  46. - :ref:`InputEvent<class_InputEvent>` **get_shortcut** **(** **)**
  47. The shortcut's :ref:`InputEvent<class_InputEvent>`.
  48. Generally the :ref:`InputEvent<class_InputEvent>` is a keyboard key, though it can be any :ref:`InputEvent<class_InputEvent>`.
  49. .. rst-class:: classref-section-separator
  50. ----
  51. .. rst-class:: classref-descriptions-group
  52. Method Descriptions
  53. -------------------
  54. .. _class_ShortCut_method_get_as_text:
  55. .. rst-class:: classref-method
  56. :ref:`String<class_String>` **get_as_text** **(** **)** |const|
  57. Returns the shortcut's :ref:`InputEvent<class_InputEvent>` as a :ref:`String<class_String>`.
  58. .. rst-class:: classref-item-separator
  59. ----
  60. .. _class_ShortCut_method_is_shortcut:
  61. .. rst-class:: classref-method
  62. :ref:`bool<class_bool>` **is_shortcut** **(** :ref:`InputEvent<class_InputEvent>` event **)** |const|
  63. Returns ``true`` if the shortcut's :ref:`InputEvent<class_InputEvent>` equals ``event``.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_ShortCut_method_is_valid:
  67. .. rst-class:: classref-method
  68. :ref:`bool<class_bool>` **is_valid** **(** **)** |const|
  69. If ``true``, this shortcut is valid.
  70. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  71. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  72. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  73. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`