InputMap.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="InputMap" inherits="Object" category="Core" version="3.1.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 [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/3.1/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. </description>
  64. </method>
  65. <method name="add_action">
  66. <return type="void">
  67. </return>
  68. <argument index="0" name="action" type="String">
  69. </argument>
  70. <argument index="1" name="deadzone" type="float" default="0.5">
  71. </argument>
  72. <description>
  73. Adds an empty action to the [code]InputMap[/code] with a configurable [code]deadzone[/code].
  74. An [InputEvent] can then be added to this action with [method action_add_event].
  75. </description>
  76. </method>
  77. <method name="erase_action">
  78. <return type="void">
  79. </return>
  80. <argument index="0" name="action" type="String">
  81. </argument>
  82. <description>
  83. Removes an action from the [code]InputMap[/code].
  84. </description>
  85. </method>
  86. <method name="event_is_action" qualifiers="const">
  87. <return type="bool">
  88. </return>
  89. <argument index="0" name="event" type="InputEvent">
  90. </argument>
  91. <argument index="1" name="action" type="String">
  92. </argument>
  93. <description>
  94. 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.
  95. </description>
  96. </method>
  97. <method name="get_action_list">
  98. <return type="Array">
  99. </return>
  100. <argument index="0" name="action" type="String">
  101. </argument>
  102. <description>
  103. Returns an array of [InputEvent]s associated with a given action.
  104. </description>
  105. </method>
  106. <method name="get_actions">
  107. <return type="Array">
  108. </return>
  109. <description>
  110. Returns an array of all actions in the [code]InputMap[/code].
  111. </description>
  112. </method>
  113. <method name="has_action" qualifiers="const">
  114. <return type="bool">
  115. </return>
  116. <argument index="0" name="action" type="String">
  117. </argument>
  118. <description>
  119. Returns [code]true[/code] if the [code]InputMap[/code] has a registered action with the given name.
  120. </description>
  121. </method>
  122. <method name="load_from_globals">
  123. <return type="void">
  124. </return>
  125. <description>
  126. Clears all [InputEventAction] in the [code]InputMap[/code] and load it anew from [ProjectSettings].
  127. </description>
  128. </method>
  129. </methods>
  130. <constants>
  131. </constants>
  132. </class>