class_inputeventjoystickmotion.rst 5.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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_InputEventJoystickMotion:
  4. InputEventJoystickMotion
  5. ========================
  6. **Category:** Built-In Types
  7. Brief Description
  8. -----------------
  9. Built-in input event type for joystick motion/axis events.
  10. Member Functions
  11. ----------------
  12. +--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
  13. | :ref:`bool<class_bool>` | :ref:`is_action<class_InputEventJoystickMotion_is_action>` **(** :ref:`String<class_string>` action **)** |
  14. +--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`is_action_pressed<class_InputEventJoystickMotion_is_action_pressed>` **(** :ref:`String<class_string>` action **)** |
  16. +--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`is_action_released<class_InputEventJoystickMotion_is_action_released>` **(** :ref:`String<class_string>` action **)** |
  18. +--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`is_echo<class_InputEventJoystickMotion_is_echo>` **(** **)** |
  20. +--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`is_pressed<class_InputEventJoystickMotion_is_pressed>` **(** **)** |
  22. +--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`set_as_action<class_InputEventJoystickMotion_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:`int<class_int>` **axis** - Joystick axis identifier, one of the JOY_AXIS_* constants in [@Global Scope].
  29. - :ref:`int<class_int>` **device** - Device identifier.
  30. - :ref:`int<class_int>` **type** - Type of event (one of the [InputEvent] constants).
  31. - :ref:`float<class_float>` **value** - Position of the axis, ranging from -1.0 to 1.0. A value of 0 means that the axis is in its neutral position.
  32. Numeric Constants
  33. -----------------
  34. - **NONE** = **0** --- Empty input event.
  35. - **KEY** = **1** --- Key event.
  36. - **MOUSE_MOTION** = **2** --- Mouse motion event.
  37. - **MOUSE_BUTTON** = **3** --- Mouse button event.
  38. - **JOYSTICK_MOTION** = **4** --- Joystick motion event.
  39. - **JOYSTICK_BUTTON** = **5** --- Joystick button event.
  40. - **SCREEN_TOUCH** = **6** --- Screen touch event.
  41. - **SCREEN_DRAG** = **7** --- Screen drag event.
  42. - **ACTION** = **8** --- Pre-defined action event (see :ref:`InputMap<class_inputmap>`).
  43. Description
  44. -----------
  45. Input event type for joystick motion/axis events that extends the global :ref:`InputEvent<class_inputevent>` type.
  46. Member Function Description
  47. ---------------------------
  48. .. _class_InputEventJoystickMotion_is_action:
  49. - :ref:`bool<class_bool>` **is_action** **(** :ref:`String<class_string>` action **)**
  50. .. _class_InputEventJoystickMotion_is_action_pressed:
  51. - :ref:`bool<class_bool>` **is_action_pressed** **(** :ref:`String<class_string>` action **)**
  52. Return whether the given action is being pressed.
  53. .. _class_InputEventJoystickMotion_is_action_released:
  54. - :ref:`bool<class_bool>` **is_action_released** **(** :ref:`String<class_string>` action **)**
  55. Return whether the given action is released (i.e. not pressed).
  56. .. _class_InputEventJoystickMotion_is_echo:
  57. - :ref:`bool<class_bool>` **is_echo** **(** **)**
  58. Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type).
  59. .. _class_InputEventJoystickMotion_is_pressed:
  60. - :ref:`bool<class_bool>` **is_pressed** **(** **)**
  61. Return if this input event is pressed.
  62. .. _class_InputEventJoystickMotion_set_as_action:
  63. - void **set_as_action** **(** :ref:`String<class_string>` action, :ref:`bool<class_bool>` pressed **)**
  64. Change the input event to an action event of the given name with the pressed status passed as argument.