2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-02-14 14:18:53 +01:00
<class name= "InputMap" inherits= "Object" version= "4.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 22:42:36 +02:00
<brief_description >
2017-10-16 00:07:13 +02:00
Singleton that manages [InputEventAction].
2017-09-12 22:42:36 +02:00
</brief_description>
<description >
2019-06-22 01:04:47 +02:00
Manages all [InputEventAction] which can be created/modified from the project settings menu [b]Project > Project Settings > Input Map[/b] or in code with [method add_action] and [method action_add_event]. See [method Node._input].
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
2021-11-15 10:43:07 +01:00
<link title= "InputEvent: InputMap" > $DOCS_URL/tutorials/inputs/inputevent.html#inputmap</link>
2017-09-12 22:42:36 +02:00
</tutorials>
<methods >
<method name= "action_add_event" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
<param index= "1" name= "event" type= "InputEvent" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-16 00:07:13 +02:00
Adds an [InputEvent] to an action. This [InputEvent] will trigger the action.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "action_erase_event" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
<param index= "1" name= "event" type= "InputEvent" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-16 00:07:13 +02:00
Removes an [InputEvent] from an action.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-05-12 09:38:00 +02:00
<method name= "action_erase_events" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
2018-05-12 09:38:00 +02:00
<description >
2018-08-19 06:29:12 +02:00
Removes all events from an action.
2018-05-12 09:38:00 +02:00
</description>
</method>
2021-07-02 06:02:28 +02:00
<method name= "action_get_deadzone" >
2021-07-30 15:28:05 +02:00
<return type= "float" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
2021-07-02 06:02:28 +02:00
<description >
Returns a deadzone value for the action.
</description>
</method>
2020-06-17 15:06:13 +02:00
<method name= "action_get_events" >
2022-08-05 20:35:08 +02:00
<return type= "InputEvent[]" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
2020-06-17 15:06:13 +02:00
<description >
Returns an array of [InputEvent]s associated with a given action.
2022-05-03 19:44:40 +02:00
[b]Note:[/b] When used in the editor (e.g. a tool script or [EditorPlugin]), this method will return events for the editor action. If you want to access your project's input binds from the editor, read the [code]input/*[/code] settings from [ProjectSettings].
2020-06-17 15:06:13 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "action_has_event" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
<param index= "1" name= "event" type= "InputEvent" />
2017-09-12 22:42:36 +02:00
<description >
2018-08-19 06:29:12 +02:00
Returns [code]true[/code] if the action has the given [InputEvent] associated with it.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-05-12 09:38:00 +02:00
<method name= "action_set_deadzone" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
<param index= "1" name= "deadzone" type= "float" />
2018-05-12 09:38:00 +02:00
<description >
2020-01-10 19:46:41 +01:00
Sets a deadzone value for the action.
2018-05-12 09:38:00 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "add_action" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
<param index= "1" name= "deadzone" type= "float" default= "0.5" />
2017-09-12 22:42:36 +02:00
<description >
2022-08-12 18:07:53 +02:00
Adds an empty action to the [InputMap] with a configurable [param deadzone].
2018-05-12 09:38:00 +02:00
An [InputEvent] can then be added to this action with [method action_add_event].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "erase_action" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
2017-09-12 22:42:36 +02:00
<description >
2019-03-29 23:37:35 +01:00
Removes an action from the [InputMap].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "event_is_action" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "event" type= "InputEvent" />
<param index= "1" name= "action" type= "StringName" />
<param index= "2" name= "exact_match" type= "bool" default= "false" />
2017-09-12 22:42:36 +02:00
<description >
2019-01-07 10:02:04 +01:00
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.
2022-08-12 18:07:53 +02:00
If [param exact_match] is [code]false[/code], it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_actions" >
2022-08-05 20:35:08 +02:00
<return type= "StringName[]" />
2017-09-12 22:42:36 +02:00
<description >
2019-03-29 23:37:35 +01:00
Returns an array of all actions in the [InputMap].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "has_action" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "action" type= "StringName" />
2017-09-12 22:42:36 +02:00
<description >
2019-03-29 23:37:35 +01:00
Returns [code]true[/code] if the [InputMap] has a registered action with the given name.
2017-09-12 22:42:36 +02:00
</description>
</method>
2020-11-23 23:44:44 +01:00
<method name= "load_from_project_settings" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2017-09-12 22:42:36 +02:00
<description >
2019-03-29 23:37:35 +01:00
Clears all [InputEventAction] in the [InputMap] and load it anew from [ProjectSettings].
2017-09-12 22:42:36 +02:00
</description>
</method>
</methods>
</class>