W3cubDocs

/Godot 3.0

InputMap

Inherits: Object

Category: Core

Brief Description

Singleton that manages InputEventAction.

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
Array get_action_list ( String action )
Array get_actions ( )
bool has_action ( String action ) const
void load_from_globals ( )

Description

Manages all InputEventAction which can be created/modified from the project settings menu Project > Project Settings > Input Map or in code with add_action and action_add_event. See Node._input.

Member Function Description

void action_add_event ( String action, InputEvent event )

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

void action_erase_event ( String action, InputEvent event )

Removes an InputEvent from an action.

bool action_has_event ( String action, InputEvent event )

Returns true if an action has an InputEvent associated with it.

void add_action ( String action )

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

void erase_action ( String action )

Removes an action from the InputMap.

bool event_is_action ( InputEvent event, String action ) 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.

Array get_action_list ( String action )

Returns an array of InputEvents associated with a given action.

Array get_actions ( )

Returns an array of all actions in the InputMap.

bool has_action ( String action ) const

Returns true if the InputMap has a registered action with the given name.

void load_from_globals ( )

Clears all InputEventAction in the InputMap and load it anew from ProjectSettings.

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