Index · Object → InputMap

InputMap

A singleton that manages all InputEventActions.

Class 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

func action_add_event(action: StringName, event: InputEvent) -> void

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

func action_erase_event(action: StringName, event: InputEvent) -> void

Removes an InputEvent from an action.

func action_erase_events(action: StringName) -> void

Removes all events from an action.

func action_get_deadzone(action: StringName) -> float

Returns a deadzone value for the action.

func action_get_events(action: StringName) -> InputEvent[]

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.

func action_has_event(action: StringName, event: InputEvent) -> bool

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

func action_set_deadzone(action: StringName, deadzone: float) -> void

Sets a deadzone value for the action.

func add_action(action: StringName, deadzone: float = 0.2) -> void

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

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

func erase_action(action: StringName) -> void

Removes an action from the InputMap.

func event_is_action(event: InputEvent, action: StringName, exact_match: bool = false) -> bool

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.

func get_action_description(action: StringName) -> String

Returns the human-readable description of the given action.

func get_actions() -> StringName[]

Returns an array of all actions in the InputMap.

func has_action(action: StringName) -> bool

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

func load_from_project_settings() -> void

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

Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

signal project_settings_loaded()

Emitted when the ProjectSettings InputMap has been loaded.

Inherited from Object (2)