class_inputeventkey.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_InputEventKey:
  4. InputEventKey
  5. =============
  6. **Category:** Built-In Types
  7. Brief Description
  8. -----------------
  9. Built-in input event type for keyboard events.
  10. Member Functions
  11. ----------------
  12. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  13. | :ref:`bool<class_bool>` | :ref:`is_action<class_InputEventKey_is_action>` **(** :ref:`String<class_string>` action **)** |
  14. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`is_action_pressed<class_InputEventKey_is_action_pressed>` **(** :ref:`String<class_string>` action **)** |
  16. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`is_action_released<class_InputEventKey_is_action_released>` **(** :ref:`String<class_string>` action **)** |
  18. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`is_echo<class_InputEventKey_is_echo>` **(** **)** |
  20. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`is_pressed<class_InputEventKey_is_pressed>` **(** **)** |
  22. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`set_as_action<class_InputEventKey_set_as_action>` **(** :ref:`String<class_string>` action, :ref:`bool<class_bool>` pressed **)** |
  24. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  25. Member Variables
  26. ----------------
  27. - :ref:`int<class_int>` **ID** - Event identifier, positive integer increased at each new event.
  28. - :ref:`bool<class_bool>` **alt** - State of the Alt modifier.
  29. - :ref:`bool<class_bool>` **control** - State of the Ctrl modifier.
  30. - :ref:`int<class_int>` **device** - Device identifier.
  31. - :ref:`bool<class_bool>` **echo** - Echo state of the key, i.e. whether it's a repeat event or not.
  32. - :ref:`bool<class_bool>` **meta** - State of the Meta modifier.
  33. - :ref:`bool<class_bool>` **pressed** - Pressed state of the key.
  34. - :ref:`int<class_int>` **scancode** - Scancode of the key, one of the KEY_* constants in [@Global Scope].
  35. - :ref:`bool<class_bool>` **shift** - State of the Shift modifier.
  36. - :ref:`int<class_int>` **type** - Type of event (one of the [InputEvent] constants).
  37. - :ref:`int<class_int>` **unicode** - Unicode identifier of the key (when relevant).
  38. Numeric Constants
  39. -----------------
  40. - **NONE** = **0** --- Empty input event.
  41. - **KEY** = **1** --- Key event.
  42. - **MOUSE_MOTION** = **2** --- Mouse motion event.
  43. - **MOUSE_BUTTON** = **3** --- Mouse button event.
  44. - **JOYSTICK_MOTION** = **4** --- Joystick motion event.
  45. - **JOYSTICK_BUTTON** = **5** --- Joystick button event.
  46. - **SCREEN_TOUCH** = **6** --- Screen touch event.
  47. - **SCREEN_DRAG** = **7** --- Screen drag event.
  48. - **ACTION** = **8** --- Pre-defined action event (see :ref:`InputMap<class_inputmap>`).
  49. Description
  50. -----------
  51. Input event type for keyboard events that extends the global :ref:`InputEvent<class_inputevent>` type.
  52. Member Function Description
  53. ---------------------------
  54. .. _class_InputEventKey_is_action:
  55. - :ref:`bool<class_bool>` **is_action** **(** :ref:`String<class_string>` action **)**
  56. Return if this input event matches a pre-defined action.
  57. .. _class_InputEventKey_is_action_pressed:
  58. - :ref:`bool<class_bool>` **is_action_pressed** **(** :ref:`String<class_string>` action **)**
  59. Return whether the given action is being pressed.
  60. .. _class_InputEventKey_is_action_released:
  61. - :ref:`bool<class_bool>` **is_action_released** **(** :ref:`String<class_string>` action **)**
  62. Return whether the given action is released (i.e. not pressed).
  63. .. _class_InputEventKey_is_echo:
  64. - :ref:`bool<class_bool>` **is_echo** **(** **)**
  65. Return if this input event is an echo event.
  66. .. _class_InputEventKey_is_pressed:
  67. - :ref:`bool<class_bool>` **is_pressed** **(** **)**
  68. Return if this input event is pressed.
  69. .. _class_InputEventKey_set_as_action:
  70. - void **set_as_action** **(** :ref:`String<class_string>` action, :ref:`bool<class_bool>` pressed **)**
  71. Change the input event to an action event of the given name with the pressed status passed as argument.