class_inputeventkey.rst 3.8 KB

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