InputMap

Inherits: Object

Singleton that manages InputEventAction.

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.

Methods

void

action_add_event ( StringName action, InputEvent event )

void

action_erase_event ( StringName action, InputEvent event )

void

action_erase_events ( StringName action )

float

action_get_deadzone ( StringName action )

Array

action_get_events ( StringName action )

bool

action_has_event ( StringName action, InputEvent event )

void

action_set_deadzone ( StringName action, float deadzone )

void

add_action ( StringName action, float deadzone=0.5 )

void

erase_action ( StringName action )

bool

event_is_action ( InputEvent event, StringName action, bool exact_match=false ) const

Array

get_actions ( )

bool

has_action ( StringName action ) const

void

load_from_project_settings ( )

Method Descriptions

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


Removes an InputEvent from an action.


Removes all events from an action.


Returns a deadzone value for the action.


Returns an array of InputEvents associated with a given action.


Returns true if the action has the given InputEvent associated with it.


Sets a deadzone value for the action.


Adds an empty action to the InputMap with a configurable deadzone.

An InputEvent can then be added to this action with action_add_event.


Removes an action from the InputMap.


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 the input modifiers for InputEventKey and InputEventMouseButton events, and the direction for InputEventJoypadMotion events.


Returns an array of all actions in the InputMap.


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


  • void load_from_project_settings ( )

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