class_inputevent.rst 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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_InputEvent:
  4. InputEvent
  5. ==========
  6. **Category:** Built-In Types
  7. Brief Description
  8. -----------------
  9. Built-in input event data.
  10. Member Functions
  11. ----------------
  12. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  13. | :ref:`bool<class_bool>` | :ref:`is_action<class_InputEvent_is_action>` **(** :ref:`String<class_string>` action **)** |
  14. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`is_action_pressed<class_InputEvent_is_action_pressed>` **(** :ref:`String<class_string>` is_action_pressed **)** |
  16. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`is_action_released<class_InputEvent_is_action_released>` **(** :ref:`String<class_string>` is_action_released **)** |
  18. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`is_echo<class_InputEvent_is_echo>` **(** **)** |
  20. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`is_pressed<class_InputEvent_is_pressed>` **(** **)** |
  22. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`set_as_action<class_InputEvent_set_as_action>` **(** :ref:`String<class_string>` action, :ref:`bool<class_bool>` pressed **)** |
  24. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  25. Member Variables
  26. ----------------
  27. - :ref:`int<class_int>` **type**
  28. - :ref:`int<class_int>` **device**
  29. - :ref:`int<class_int>` **ID**
  30. Numeric Constants
  31. -----------------
  32. - **NONE** = **0** --- Empty input event.
  33. - **KEY** = **1** --- Key event.
  34. - **MOUSE_MOTION** = **2** --- Mouse motion event.
  35. - **MOUSE_BUTTON** = **3** --- Mouse button event.
  36. - **JOYSTICK_MOTION** = **4** --- Joystick motion event.
  37. - **JOYSTICK_BUTTON** = **5** --- Joystick button event.
  38. - **SCREEN_TOUCH** = **6**
  39. - **SCREEN_DRAG** = **7**
  40. - **ACTION** = **8**
  41. Description
  42. -----------
  43. Built-in input event data. InputEvent is a built-in engine datatype, given that it's passed around and used so much. Depending on it's type, the members contained can be different, so read the documentation well!. Input events can also represent actions (editable from the project settings).
  44. Member Function Description
  45. ---------------------------
  46. .. _class_InputEvent_is_action:
  47. - :ref:`bool<class_bool>` **is_action** **(** :ref:`String<class_string>` action **)**
  48. Return if this input event matches a pre-defined action, no matter the type.
  49. .. _class_InputEvent_is_action_pressed:
  50. - :ref:`bool<class_bool>` **is_action_pressed** **(** :ref:`String<class_string>` is_action_pressed **)**
  51. .. _class_InputEvent_is_action_released:
  52. - :ref:`bool<class_bool>` **is_action_released** **(** :ref:`String<class_string>` is_action_released **)**
  53. .. _class_InputEvent_is_echo:
  54. - :ref:`bool<class_bool>` **is_echo** **(** **)**
  55. Return if this input event is an echo event (usually for key events).
  56. .. _class_InputEvent_is_pressed:
  57. - :ref:`bool<class_bool>` **is_pressed** **(** **)**
  58. Return if this input event is pressed (for key, mouse, joy button or screen press events).
  59. .. _class_InputEvent_set_as_action:
  60. - void **set_as_action** **(** :ref:`String<class_string>` action, :ref:`bool<class_bool>` pressed **)**