InputMap.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InputMap" inherits="Object" version="3.2">
  3. <brief_description>
  4. Singleton that manages [InputEventAction].
  5. </brief_description>
  6. <description>
  7. Manages all [InputEventAction] which can be created/modified from the project settings menu [b]Project &gt; Project Settings &gt; Input Map[/b] or in code with [method add_action] and [method action_add_event]. See [method Node._input].
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap</link>
  11. </tutorials>
  12. <methods>
  13. <method name="action_add_event">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="action" type="String">
  17. </argument>
  18. <argument index="1" name="event" type="InputEvent">
  19. </argument>
  20. <description>
  21. Adds an [InputEvent] to an action. This [InputEvent] will trigger the action.
  22. </description>
  23. </method>
  24. <method name="action_erase_event">
  25. <return type="void">
  26. </return>
  27. <argument index="0" name="action" type="String">
  28. </argument>
  29. <argument index="1" name="event" type="InputEvent">
  30. </argument>
  31. <description>
  32. Removes an [InputEvent] from an action.
  33. </description>
  34. </method>
  35. <method name="action_erase_events">
  36. <return type="void">
  37. </return>
  38. <argument index="0" name="action" type="String">
  39. </argument>
  40. <description>
  41. Removes all events from an action.
  42. </description>
  43. </method>
  44. <method name="action_has_event">
  45. <return type="bool">
  46. </return>
  47. <argument index="0" name="action" type="String">
  48. </argument>
  49. <argument index="1" name="event" type="InputEvent">
  50. </argument>
  51. <description>
  52. Returns [code]true[/code] if the action has the given [InputEvent] associated with it.
  53. </description>
  54. </method>
  55. <method name="action_set_deadzone">
  56. <return type="void">
  57. </return>
  58. <argument index="0" name="action" type="String">
  59. </argument>
  60. <argument index="1" name="deadzone" type="float">
  61. </argument>
  62. <description>
  63. Sets a deadzone value for the action.
  64. </description>
  65. </method>
  66. <method name="add_action">
  67. <return type="void">
  68. </return>
  69. <argument index="0" name="action" type="String">
  70. </argument>
  71. <argument index="1" name="deadzone" type="float" default="0.5">
  72. </argument>
  73. <description>
  74. Adds an empty action to the [InputMap] with a configurable [code]deadzone[/code].
  75. An [InputEvent] can then be added to this action with [method action_add_event].
  76. </description>
  77. </method>
  78. <method name="erase_action">
  79. <return type="void">
  80. </return>
  81. <argument index="0" name="action" type="String">
  82. </argument>
  83. <description>
  84. Removes an action from the [InputMap].
  85. </description>
  86. </method>
  87. <method name="event_is_action" qualifiers="const">
  88. <return type="bool">
  89. </return>
  90. <argument index="0" name="event" type="InputEvent">
  91. </argument>
  92. <argument index="1" name="action" type="String">
  93. </argument>
  94. <description>
  95. Returns [code]true[/code] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior.
  96. </description>
  97. </method>
  98. <method name="get_action_list">
  99. <return type="Array">
  100. </return>
  101. <argument index="0" name="action" type="String">
  102. </argument>
  103. <description>
  104. Returns an array of [InputEvent]s associated with a given action.
  105. </description>
  106. </method>
  107. <method name="get_actions">
  108. <return type="Array">
  109. </return>
  110. <description>
  111. Returns an array of all actions in the [InputMap].
  112. </description>
  113. </method>
  114. <method name="has_action" qualifiers="const">
  115. <return type="bool">
  116. </return>
  117. <argument index="0" name="action" type="String">
  118. </argument>
  119. <description>
  120. Returns [code]true[/code] if the [InputMap] has a registered action with the given name.
  121. </description>
  122. </method>
  123. <method name="load_from_globals">
  124. <return type="void">
  125. </return>
  126. <description>
  127. Clears all [InputEventAction] in the [InputMap] and load it anew from [ProjectSettings].
  128. </description>
  129. </method>
  130. </methods>
  131. <constants>
  132. </constants>
  133. </class>