class_inputeventkey.rst 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the InputEventKey.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_InputEventKey:
  6. InputEventKey
  7. =============
  8. **Inherits:** :ref:`InputEventWithModifiers<class_InputEventWithModifiers>` **<** :ref:`InputEvent<class_InputEvent>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Input event type for keyboard events.
  13. Properties
  14. ----------
  15. +-------------------------+--------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`echo<class_InputEventKey_property_echo>` |
  17. +-------------------------+--------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`pressed<class_InputEventKey_property_pressed>` |
  19. +-------------------------+--------------------------------------------------------+
  20. | :ref:`int<class_int>` | :ref:`scancode<class_InputEventKey_property_scancode>` |
  21. +-------------------------+--------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`unicode<class_InputEventKey_property_unicode>` |
  23. +-------------------------+--------------------------------------------------------+
  24. Methods
  25. -------
  26. +-----------------------+--------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`get_scancode_with_modifiers<class_InputEventKey_method_get_scancode_with_modifiers>` **(** **)** const |
  28. +-----------------------+--------------------------------------------------------------------------------------------------------------+
  29. Description
  30. -----------
  31. Stores key presses on the keyboard. Supports key presses, key releases and :ref:`echo<class_InputEventKey_property_echo>` events.
  32. Tutorials
  33. ---------
  34. - :doc:`../tutorials/inputs/inputevent`
  35. Property Descriptions
  36. ---------------------
  37. .. _class_InputEventKey_property_echo:
  38. - :ref:`bool<class_bool>` **echo**
  39. +----------+-----------------+
  40. | *Setter* | set_echo(value) |
  41. +----------+-----------------+
  42. | *Getter* | is_echo() |
  43. +----------+-----------------+
  44. If ``true``, the key was already pressed before this event. It means the user is holding the key down.
  45. ----
  46. .. _class_InputEventKey_property_pressed:
  47. - :ref:`bool<class_bool>` **pressed**
  48. +----------+--------------------+
  49. | *Setter* | set_pressed(value) |
  50. +----------+--------------------+
  51. | *Getter* | is_pressed() |
  52. +----------+--------------------+
  53. If ``true``, the key's state is pressed. If ``false``, the key's state is released.
  54. ----
  55. .. _class_InputEventKey_property_scancode:
  56. - :ref:`int<class_int>` **scancode**
  57. +----------+---------------------+
  58. | *Setter* | set_scancode(value) |
  59. +----------+---------------------+
  60. | *Getter* | get_scancode() |
  61. +----------+---------------------+
  62. Key scancode, one of the ``KEY_*`` constants in :ref:`@GlobalScope<class_@GlobalScope>`.
  63. ----
  64. .. _class_InputEventKey_property_unicode:
  65. - :ref:`int<class_int>` **unicode**
  66. +----------+--------------------+
  67. | *Setter* | set_unicode(value) |
  68. +----------+--------------------+
  69. | *Getter* | get_unicode() |
  70. +----------+--------------------+
  71. Key unicode identifier when relevant.
  72. Method Descriptions
  73. -------------------
  74. .. _class_InputEventKey_method_get_scancode_with_modifiers:
  75. - :ref:`int<class_int>` **get_scancode_with_modifiers** **(** **)** const
  76. Returns the scancode combined with modifier keys such as ``Shift`` or ``Alt``. See also :ref:`InputEventWithModifiers<class_InputEventWithModifiers>`.