InputEvent.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InputEvent" inherits="Resource" category="Core" version="3.0.alpha.custom_build">
  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. http://docs.godotengine.org/en/stable/learning/features/inputs/inputevent.html
  11. </tutorials>
  12. <demos>
  13. </demos>
  14. <methods>
  15. <method name="action_match" qualifiers="const">
  16. <return type="bool">
  17. </return>
  18. <argument index="0" name="event" type="InputEvent">
  19. </argument>
  20. <description>
  21. Returns [code]true[/code] if this event matches [code]event[event].
  22. </description>
  23. </method>
  24. <method name="as_text" qualifiers="const">
  25. <return type="String">
  26. </return>
  27. <description>
  28. Returns a [String] representation of the event.
  29. </description>
  30. </method>
  31. <method name="get_device" qualifiers="const">
  32. <return type="int">
  33. </return>
  34. <description>
  35. Returns the device's id that generated the event.
  36. </description>
  37. </method>
  38. <method name="get_id" qualifiers="const">
  39. <return type="int">
  40. </return>
  41. <description>
  42. Returns the event's ID.
  43. </description>
  44. </method>
  45. <method name="is_action" qualifiers="const">
  46. <return type="bool">
  47. </return>
  48. <argument index="0" name="action" type="String">
  49. </argument>
  50. <description>
  51. Returns [code]true[/code] if this input event matches a pre-defined action of any type.
  52. </description>
  53. </method>
  54. <method name="is_action_pressed" qualifiers="const">
  55. <return type="bool">
  56. </return>
  57. <argument index="0" name="action" type="String">
  58. </argument>
  59. <description>
  60. 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].
  61. </description>
  62. </method>
  63. <method name="is_action_released" qualifiers="const">
  64. <return type="bool">
  65. </return>
  66. <argument index="0" name="action" type="String">
  67. </argument>
  68. <description>
  69. 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].
  70. </description>
  71. </method>
  72. <method name="is_action_type" qualifiers="const">
  73. <return type="bool">
  74. </return>
  75. <description>
  76. Returns [code]true[/code] if this input event's type is one of the [code]InputEvent[/code] constants.
  77. </description>
  78. </method>
  79. <method name="is_echo" qualifiers="const">
  80. <return type="bool">
  81. </return>
  82. <description>
  83. Returns [code]true[/code] if this input event is an echo event (only for events of type KEY).
  84. </description>
  85. </method>
  86. <method name="is_pressed" qualifiers="const">
  87. <return type="bool">
  88. </return>
  89. <description>
  90. 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].
  91. </description>
  92. </method>
  93. <method name="set_device">
  94. <return type="void">
  95. </return>
  96. <argument index="0" name="device" type="int">
  97. </argument>
  98. <description>
  99. </description>
  100. </method>
  101. <method name="set_id">
  102. <return type="void">
  103. </return>
  104. <argument index="0" name="id" type="int">
  105. </argument>
  106. <description>
  107. </description>
  108. </method>
  109. <method name="shortcut_match" qualifiers="const">
  110. <return type="bool">
  111. </return>
  112. <argument index="0" name="event" type="InputEvent">
  113. </argument>
  114. <description>
  115. </description>
  116. </method>
  117. <method name="xformed_by" qualifiers="const">
  118. <return type="InputEvent">
  119. </return>
  120. <argument index="0" name="xform" type="Transform2D">
  121. </argument>
  122. <argument index="1" name="local_ofs" type="Vector2" default="Vector2( 0, 0 )">
  123. </argument>
  124. <description>
  125. </description>
  126. </method>
  127. </methods>
  128. <members>
  129. <member name="device" type="int" setter="set_device" getter="get_device">
  130. The event's device ID.
  131. </member>
  132. </members>
  133. <constants>
  134. </constants>
  135. </class>