InputMap.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InputMap" inherits="Object" category="Core" version="3.1">
  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 [code]Project &gt; Project Settings &gt; Input Map[/code] 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. <demos>
  13. </demos>
  14. <methods>
  15. <method name="action_add_event">
  16. <return type="void">
  17. </return>
  18. <argument index="0" name="action" type="String">
  19. </argument>
  20. <argument index="1" name="event" type="InputEvent">
  21. </argument>
  22. <description>
  23. Adds an [InputEvent] to an action. This [InputEvent] will trigger the action.
  24. </description>
  25. </method>
  26. <method name="action_erase_event">
  27. <return type="void">
  28. </return>
  29. <argument index="0" name="action" type="String">
  30. </argument>
  31. <argument index="1" name="event" type="InputEvent">
  32. </argument>
  33. <description>
  34. Removes an [InputEvent] from an action.
  35. </description>
  36. </method>
  37. <method name="action_erase_events">
  38. <return type="void">
  39. </return>
  40. <argument index="0" name="action" type="String">
  41. </argument>
  42. <description>
  43. Removes all events from an action.
  44. </description>
  45. </method>
  46. <method name="action_has_event">
  47. <return type="bool">
  48. </return>
  49. <argument index="0" name="action" type="String">
  50. </argument>
  51. <argument index="1" name="event" type="InputEvent">
  52. </argument>
  53. <description>
  54. Returns [code]true[/code] if the action has the given [InputEvent] associated with it.
  55. </description>
  56. </method>
  57. <method name="action_set_deadzone">
  58. <return type="void">
  59. </return>
  60. <argument index="0" name="action" type="String">
  61. </argument>
  62. <argument index="1" name="deadzone" type="float">
  63. </argument>
  64. <description>
  65. </description>
  66. </method>
  67. <method name="add_action">
  68. <return type="void">
  69. </return>
  70. <argument index="0" name="action" type="String">
  71. </argument>
  72. <argument index="1" name="deadzone" type="float" default="0.5">
  73. </argument>
  74. <description>
  75. Adds an empty action to the [code]InputMap[/code] with a configurable [code]deadzone[/code].
  76. An [InputEvent] can then be added to this action with [method action_add_event].
  77. </description>
  78. </method>
  79. <method name="erase_action">
  80. <return type="void">
  81. </return>
  82. <argument index="0" name="action" type="String">
  83. </argument>
  84. <description>
  85. Removes an action from the [code]InputMap[/code].
  86. </description>
  87. </method>
  88. <method name="event_is_action" qualifiers="const">
  89. <return type="bool">
  90. </return>
  91. <argument index="0" name="event" type="InputEvent">
  92. </argument>
  93. <argument index="1" name="action" type="String">
  94. </argument>
  95. <description>
  96. Returns [true] 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.
  97. </description>
  98. </method>
  99. <method name="get_action_list">
  100. <return type="Array">
  101. </return>
  102. <argument index="0" name="action" type="String">
  103. </argument>
  104. <description>
  105. Returns an array of [InputEvent]s associated with a given action.
  106. </description>
  107. </method>
  108. <method name="get_actions">
  109. <return type="Array">
  110. </return>
  111. <description>
  112. Returns an array of all actions in the [code]InputMap[/code].
  113. </description>
  114. </method>
  115. <method name="has_action" qualifiers="const">
  116. <return type="bool">
  117. </return>
  118. <argument index="0" name="action" type="String">
  119. </argument>
  120. <description>
  121. Returns [code]true[/code] if the [code]InputMap[/code] has a registered action with the given name.
  122. </description>
  123. </method>
  124. <method name="load_from_globals">
  125. <return type="void">
  126. </return>
  127. <description>
  128. Clears all [InputEventAction] in the [code]InputMap[/code] and load it anew from [ProjectSettings].
  129. </description>
  130. </method>
  131. </methods>
  132. <constants>
  133. </constants>
  134. </class>