class_inputeventkey.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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>` | false |
  17. +-------------------------+--------------------------------------------------------+-------+
  18. | :ref:`bool<class_bool>` | :ref:`pressed<class_InputEventKey_property_pressed>` | false |
  19. +-------------------------+--------------------------------------------------------+-------+
  20. | :ref:`int<class_int>` | :ref:`scancode<class_InputEventKey_property_scancode>` | 0 |
  21. +-------------------------+--------------------------------------------------------+-------+
  22. | :ref:`int<class_int>` | :ref:`unicode<class_InputEventKey_property_unicode>` | 0 |
  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. | *Default* | false |
  41. +-----------+-----------------+
  42. | *Setter* | set_echo(value) |
  43. +-----------+-----------------+
  44. | *Getter* | is_echo() |
  45. +-----------+-----------------+
  46. If ``true``, the key was already pressed before this event. It means the user is holding the key down.
  47. .. _class_InputEventKey_property_pressed:
  48. - :ref:`bool<class_bool>` **pressed**
  49. +-----------+--------------------+
  50. | *Default* | false |
  51. +-----------+--------------------+
  52. | *Setter* | set_pressed(value) |
  53. +-----------+--------------------+
  54. | *Getter* | is_pressed() |
  55. +-----------+--------------------+
  56. If ``true``, the key's state is pressed. If ``false``, the key's state is released.
  57. .. _class_InputEventKey_property_scancode:
  58. - :ref:`int<class_int>` **scancode**
  59. +-----------+---------------------+
  60. | *Default* | 0 |
  61. +-----------+---------------------+
  62. | *Setter* | set_scancode(value) |
  63. +-----------+---------------------+
  64. | *Getter* | get_scancode() |
  65. +-----------+---------------------+
  66. Key scancode, one of the :ref:`KeyList<enum_@GlobalScope_KeyList>` constants.
  67. .. _class_InputEventKey_property_unicode:
  68. - :ref:`int<class_int>` **unicode**
  69. +-----------+--------------------+
  70. | *Default* | 0 |
  71. +-----------+--------------------+
  72. | *Setter* | set_unicode(value) |
  73. +-----------+--------------------+
  74. | *Getter* | get_unicode() |
  75. +-----------+--------------------+
  76. Key Unicode identifier when relevant. Unicode identifiers for the composite characters and complex scripts may not be available unless IME input mode is active. See :ref:`OS.set_ime_active<class_OS_method_set_ime_active>` for more information.
  77. Method Descriptions
  78. -------------------
  79. .. _class_InputEventKey_method_get_scancode_with_modifiers:
  80. - :ref:`int<class_int>` **get_scancode_with_modifiers** **(** **)** const
  81. Returns the scancode combined with modifier keys such as ``Shift`` or ``Alt``. See also :ref:`InputEventWithModifiers<class_InputEventWithModifiers>`.