InputEvent.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InputEvent" inherits="Resource" category="Core" version="3.1">
  3. <brief_description>
  4. Generic input event
  5. </brief_description>
  6. <description>
  7. Base class of all sort of input event. See [method Node._input].
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
  11. <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
  12. </tutorials>
  13. <demos>
  14. </demos>
  15. <methods>
  16. <method name="as_text" qualifiers="const">
  17. <return type="String">
  18. </return>
  19. <description>
  20. Returns a [String] representation of the event.
  21. </description>
  22. </method>
  23. <method name="get_action_strength" qualifiers="const">
  24. <return type="float">
  25. </return>
  26. <argument index="0" name="action" type="String">
  27. </argument>
  28. <description>
  29. </description>
  30. </method>
  31. <method name="is_action" qualifiers="const">
  32. <return type="bool">
  33. </return>
  34. <argument index="0" name="action" type="String">
  35. </argument>
  36. <description>
  37. Returns [code]true[/code] if this input event matches a pre-defined action of any type.
  38. </description>
  39. </method>
  40. <method name="is_action_pressed" qualifiers="const">
  41. <return type="bool">
  42. </return>
  43. <argument index="0" name="action" type="String">
  44. </argument>
  45. <description>
  46. Returns [code]true[/code] if the given action is being pressed (and is not an echo event for KEY events). Not relevant for the event types [code]MOUSE_MOTION[/code], [code]SCREEN_DRAG[/code] or [code]NONE[/code].
  47. </description>
  48. </method>
  49. <method name="is_action_released" qualifiers="const">
  50. <return type="bool">
  51. </return>
  52. <argument index="0" name="action" type="String">
  53. </argument>
  54. <description>
  55. Returns [code]true[/code] if the given action is released (i.e. not pressed). Not relevant for the event types [code]MOUSE_MOTION[/code], [code]SCREEN_DRAG[/code] or [code]NONE[/code].
  56. </description>
  57. </method>
  58. <method name="is_action_type" qualifiers="const">
  59. <return type="bool">
  60. </return>
  61. <description>
  62. Returns [code]true[/code] if this input event's type is one of the [code]InputEvent[/code] constants.
  63. </description>
  64. </method>
  65. <method name="is_echo" qualifiers="const">
  66. <return type="bool">
  67. </return>
  68. <description>
  69. Returns [code]true[/code] if this input event is an echo event (only for events of type KEY).
  70. </description>
  71. </method>
  72. <method name="is_pressed" qualifiers="const">
  73. <return type="bool">
  74. </return>
  75. <description>
  76. Returns [code]true[/code] if this input event is pressed. Not relevant for the event types [code]MOUSE_MOTION[/code], [code]SCREEN_DRAG[/code] or [code]NONE[/code].
  77. </description>
  78. </method>
  79. <method name="shortcut_match" qualifiers="const">
  80. <return type="bool">
  81. </return>
  82. <argument index="0" name="event" type="InputEvent">
  83. </argument>
  84. <description>
  85. </description>
  86. </method>
  87. <method name="xformed_by" qualifiers="const">
  88. <return type="InputEvent">
  89. </return>
  90. <argument index="0" name="xform" type="Transform2D">
  91. </argument>
  92. <argument index="1" name="local_ofs" type="Vector2" default="Vector2( 0, 0 )">
  93. </argument>
  94. <description>
  95. </description>
  96. </method>
  97. </methods>
  98. <members>
  99. <member name="device" type="int" setter="set_device" getter="get_device">
  100. The event's device ID.
  101. </member>
  102. </members>
  103. <constants>
  104. </constants>
  105. </class>