InputMap

Inherits: Object InputEventAction.

Description

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.

Tutorials

  • inputmap in Using InputEvent

    Methods

    Method Descriptions

  • action_add_event ( String action, InputEvent event ) InputEvent to an action. This InputEvent will trigger the action.

  • action_erase_event ( String action, InputEvent event ) InputEvent from an action.

  • action_erase_events ( String action ) Removes all events from an action.

  • float action_get_deadzone ( String action ) Returns a deadzone value for the action.

  • bool action_has_event ( String action, InputEvent event ) true if the action has the given InputEvent associated with it.

  • action_set_deadzone ( String action, float deadzone ) Sets a deadzone value for the action.

  • add_action ( String action, float deadzone=0.5 ) InputMap with a configurable deadzone. InputEvent can then be added to this action with action_add_event.

  • erase_action ( String action ) InputMap.

  • bool event_is_action ( InputEvent event, String action, bool exact_match=false ) const 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. exact_match is false, it ignores additional input modifiers for InputEventKey and InputEventMouseButton events, and the direction for InputEventJoypadMotion events.

  • Array get_action_list ( String action ) 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.

  • Array get_actions ( ) InputMap.

  • bool has_action ( String action ) const true if the InputMap has a registered action with the given name.

  • load_from_globals ( ) InputEventAction in the InputMap and load it anew from ProjectSettings.