class_shortcut.rst 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ShortCut.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ShortCut:
  6. ShortCut
  7. ========
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. A shortcut for binding input.
  10. Description
  11. -----------
  12. A shortcut for binding input.
  13. Shortcuts are commonly used for interacting with a :ref:`Control<class_Control>` element from a :ref:`InputEvent<class_InputEvent>`.
  14. Properties
  15. ----------
  16. +-------------------------------------+---------------------------------------------------+
  17. | :ref:`InputEvent<class_InputEvent>` | :ref:`shortcut<class_ShortCut_property_shortcut>` |
  18. +-------------------------------------+---------------------------------------------------+
  19. Methods
  20. -------
  21. +-----------------------------+---------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`String<class_String>` | :ref:`get_as_text<class_ShortCut_method_get_as_text>` **(** **)** |const| |
  23. +-----------------------------+---------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`is_shortcut<class_ShortCut_method_is_shortcut>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |const| |
  25. +-----------------------------+---------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`is_valid<class_ShortCut_method_is_valid>` **(** **)** |const| |
  27. +-----------------------------+---------------------------------------------------------------------------------------------------------------------+
  28. Property Descriptions
  29. ---------------------
  30. .. _class_ShortCut_property_shortcut:
  31. - :ref:`InputEvent<class_InputEvent>` **shortcut**
  32. +----------+---------------------+
  33. | *Setter* | set_shortcut(value) |
  34. +----------+---------------------+
  35. | *Getter* | get_shortcut() |
  36. +----------+---------------------+
  37. The shortcut's :ref:`InputEvent<class_InputEvent>`.
  38. Generally the :ref:`InputEvent<class_InputEvent>` is a keyboard key, though it can be any :ref:`InputEvent<class_InputEvent>`.
  39. Method Descriptions
  40. -------------------
  41. .. _class_ShortCut_method_get_as_text:
  42. - :ref:`String<class_String>` **get_as_text** **(** **)** |const|
  43. Returns the shortcut's :ref:`InputEvent<class_InputEvent>` as a :ref:`String<class_String>`.
  44. ----
  45. .. _class_ShortCut_method_is_shortcut:
  46. - :ref:`bool<class_bool>` **is_shortcut** **(** :ref:`InputEvent<class_InputEvent>` event **)** |const|
  47. Returns ``true`` if the shortcut's :ref:`InputEvent<class_InputEvent>` equals ``event``.
  48. ----
  49. .. _class_ShortCut_method_is_valid:
  50. - :ref:`bool<class_bool>` **is_valid** **(** **)** |const|
  51. If ``true``, this shortcut is valid.
  52. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  53. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  54. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`