InputMap
Hereda: Object
A singleton that manages all InputEventActions.
Descripción
Gestiona todos los InputEventAction que pueden ser creados/modificados desde el menú de configuración del proyecto Proyecto > Configuración del proyecto > Mapa de entrada o en código con add_action() y action_add_event(). Véase Node._input().
Tutoriales
Métodos
void |
action_add_event(action: StringName, event: InputEvent) |
void |
action_erase_event(action: StringName, event: InputEvent) |
void |
action_erase_events(action: StringName) |
action_get_deadzone(action: StringName) |
|
action_get_events(action: StringName) |
|
action_has_event(action: StringName, event: InputEvent) |
|
void |
action_set_deadzone(action: StringName, deadzone: float) |
void |
add_action(action: StringName, deadzone: float = 0.2) |
void |
erase_action(action: StringName) |
event_is_action(event: InputEvent, action: StringName, exact_match: bool = false) const |
|
get_action_description(action: StringName) const |
|
has_action(action: StringName) const |
|
void |
Descripciones de Métodos
void action_add_event(action: StringName, event: InputEvent) 🔗
Añade un InputEvent a una acción. Este InputEvent desencadenará la acción.
void action_erase_event(action: StringName, event: InputEvent) 🔗
Elimina un InputEvent de una acción.
void action_erase_events(action: StringName) 🔗
Elimina todos los eventos de una acción.
float action_get_deadzone(action: StringName) 🔗
Returns a deadzone value for the action.
Array[InputEvent] action_get_events(action: StringName) 🔗
Returns an array of InputEvents associated with a given action.
Note: 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 input/* settings from ProjectSettings.
bool action_has_event(action: StringName, event: InputEvent) 🔗
Devuelve true si la acción tiene asociado el InputEvent dado.
void action_set_deadzone(action: StringName, deadzone: float) 🔗
Establece un valor de zona muerta para la acción.
void add_action(action: StringName, deadzone: float = 0.2) 🔗
Adds an empty action to the InputMap with a configurable deadzone.
An InputEvent can then be added to this action with action_add_event().
void erase_action(action: StringName) 🔗
Elimina una acción del InputMap.
bool event_is_action(event: InputEvent, action: StringName, exact_match: bool = false) const 🔗
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 action_has_event() if you don't want this behavior.
If exact_match is false, it ignores additional input modifiers for InputEventKey and InputEventMouseButton events, and the direction for InputEventJoypadMotion events.
String get_action_description(action: StringName) const 🔗
Returns the human-readable description of the given action.
Array[StringName] get_actions() 🔗
Devuelve un conjunto de todas las acciones en el InputMap.
bool has_action(action: StringName) const 🔗
Devuelve true si el InputMap tiene una acción registrada con el nombre dado.
void load_from_project_settings() 🔗
Borra todo InputEventAction en el InputMap y cárgalo de nuevo desde ProjectSettings.