InputMap

Inherits: Object

Category: Core

Brief Description

Singleton that manages actions.

Member Functions

void action_add_event ( String action, InputEvent event )
void action_erase_event ( String action, InputEvent event )
bool action_has_event ( String action, InputEvent event )
void add_action ( String action )
void erase_action ( String action )
bool event_is_action ( InputEvent event, String action ) const
String get_action_from_id ( int id ) const
int get_action_id ( String action ) const
Array get_action_list ( String action )
Array get_actions ( )
bool has_action ( String action ) const
void load_from_globals ( )

Description

Singleton that manages actions. InputMap has a list of the actions used in InputEvent, which can be modified.

Member Function Description

void action_add_event ( String action, InputEvent event )

Add an InputEvent to an action. This InputEvent will trigger the action.

void action_erase_event ( String action, InputEvent event )

Remove an InputEvent from an action.

bool action_has_event ( String action, InputEvent event )

Whether an action has an InputEvent associated with it.

void add_action ( String action )

Add an (empty) action to the InputMap. An InputEvent can then be added to this action with action_add_event.

void erase_action ( String action )

Remove an action from the InputMap.

bool event_is_action ( InputEvent event, String action ) const

Return whether the given event is part of an existing action.

String get_action_from_id ( int id ) const

Return the action corresponding to the identifier.

int get_action_id ( String action ) const

Return the identifier of the given action.

Array get_action_list ( String action )

Return an array of InputEvents associated with a given action.

Array get_actions ( )

Return an array of all actions in the InputMap.

bool has_action ( String action ) const

Whether this InputMap has a registered action with the given name.

void load_from_globals ( )

Clear the InputMap and load it anew from Globals.

© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/2.1/classes/class_inputmap.html