Skip to content

InputMap

Eduard Gushchin edited this page Jul 1, 2026 · 5 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.InputMap
Namespace Electron2D
Kind class
Category Input

Overview

Stores input actions and their input event bindings.

Syntax

public static class Electron2D.InputMap

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: InputMap

Process-wide action registry with deadzones, keyboard/mouse/gamepad bindings, direct action matching and internal settings serialization.

Remarks

An input action is a named command such as jump or move_left. The map stores a deadzone and a set of keyboard, mouse or direct action events for each action.

The map is process-wide in 0.1.0 Preview. Project-file persistence is handled by an internal serializer used by the future project settings layer, not by public file I/O methods on this type.

Thread Safety

All methods synchronize access to the process-wide action registry. Returned arrays are snapshots and may be read from any thread.

Since

This class is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Input
  • Electron2D.InputEventAction

Members

Member Kind Summary
ActionAddEvent(System.String, Electron2D.InputEvent) Method Adds an input event binding to an action.
ActionEraseEvent(System.String, Electron2D.InputEvent) Method Removes one input event binding from an action.
ActionEraseEvents(System.String) Method Removes all input event bindings from an action.
ActionGetDeadzone(System.String) Method Gets the deadzone for an action.
ActionGetEvents(System.String) Method Gets the input event bindings for an action.
ActionSetDeadzone(System.String, System.Single) Method Sets the deadzone for an action.
AddAction(System.String, System.Single) Method Adds an action to the input map.
EraseAction(System.String) Method Removes an action and its events from the input map.
EventIsAction(Electron2D.InputEvent, System.String, System.Boolean) Method Checks whether an input event matches an action.
GetActions() Method Gets the registered action names.
HasAction(System.String) Method Checks whether an action exists.

Member Details

ActionAddEvent(System.String, Electron2D.InputEvent)

Kind: Method

public static System.Void ActionAddEvent(System.String, Electron2D.InputEvent)(System.String action, Electron2D.InputEvent inputEvent)

Summary

Adds an input event binding to an action.

Remarks

Duplicate bindings are ignored. The stored binding is copied, so later mutations to inputEvent do not affect the map.

Parameters

  • action: The action name to update.
  • inputEvent: The input event binding to add.

Exceptions

  • System.ArgumentException: Thrown when action is empty, the action does not exist, or the event type cannot be used as an action binding.
  • System.ArgumentNullException: Thrown when inputEvent is null.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap.ActionEraseEvent(System.String,Electron2D.InputEvent)
  • Electron2D.InputMap.ActionGetEvents(System.String)

ActionEraseEvent(System.String, Electron2D.InputEvent)

Kind: Method

public static System.Void ActionEraseEvent(System.String, Electron2D.InputEvent)(System.String action, Electron2D.InputEvent inputEvent)

Summary

Removes one input event binding from an action.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • action: The action name to update.
  • inputEvent: The input event binding to remove.

Exceptions

  • System.ArgumentException: Thrown when action is empty, the action does not exist, or the event type cannot be used as an action binding.
  • System.ArgumentNullException: Thrown when inputEvent is null.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap.ActionAddEvent(System.String,Electron2D.InputEvent)

ActionEraseEvents(System.String)

Kind: Method

public static System.Void ActionEraseEvents(System.String)(System.String action)

Summary

Removes all input event bindings from an action.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • action: The action name to update.

Exceptions

  • System.ArgumentException: Thrown when action is empty or the action does not exist.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap

ActionGetDeadzone(System.String)

Kind: Method

public static System.Single ActionGetDeadzone(System.String)(System.String action)

Summary

Gets the deadzone for an action.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • action: The action name to query.

Returns

The action deadzone, or 0.0 when the action does not exist.

Exceptions

  • System.ArgumentException: Thrown when action is empty.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap.ActionSetDeadzone(System.String,System.Single)

ActionGetEvents(System.String)

Kind: Method

public static Electron2D.InputEvent[] ActionGetEvents(System.String)(System.String action)

Summary

Gets the input event bindings for an action.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • action: The action name to query.

Returns

A stable snapshot of copied input event bindings, or an empty array when the action does not exist.

Exceptions

  • System.ArgumentException: Thrown when action is empty.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap

ActionSetDeadzone(System.String, System.Single)

Kind: Method

public static System.Void ActionSetDeadzone(System.String, System.Single)(System.String action, System.Single deadzone)

Summary

Sets the deadzone for an action.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • action: The action name to update.
  • deadzone: The new deadzone in the range 0.0 through 1.0.

Exceptions

  • System.ArgumentException: Thrown when action is empty, the action does not exist, or deadzone is not finite or outside the supported range.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap.ActionGetDeadzone(System.String)

AddAction(System.String, System.Single)

Kind: Method

public static System.Void AddAction(System.String, System.Single)(System.String action, System.Single deadzone)

Summary

Adds an action to the input map.

Remarks

Re-adding an existing action leaves its deadzone and events unchanged.

Parameters

  • action: The action name to add.
  • deadzone: The action deadzone in the range 0.0 through 1.0.

Exceptions

  • System.ArgumentException: Thrown when action is empty or deadzone is not finite or outside the supported range.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap

EraseAction(System.String)

Kind: Method

public static System.Void EraseAction(System.String)(System.String action)

Summary

Removes an action and its events from the input map.

Remarks

Removing an unknown action is a no-op. Any runtime state tracked for the action is cleared as part of removal.

Parameters

  • action: The action name to remove.

Exceptions

  • System.ArgumentException: Thrown when action is empty.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap

EventIsAction(Electron2D.InputEvent, System.String, System.Boolean)

Kind: Method

public static System.Boolean EventIsAction(Electron2D.InputEvent, System.String, System.Boolean)(Electron2D.InputEvent inputEvent, System.String action, System.Boolean exactMatch)

Summary

Checks whether an input event matches an action.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • inputEvent: The input event to test.
  • action: The action name to test against.
  • exactMatch: Reserved for exact modifier/device matching in future input work.

Returns

true when the event matches the action and passes the action deadzone; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when action is empty.
  • System.ArgumentNullException: Thrown when inputEvent is null.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Input.IsActionPressed(System.String,System.Boolean)

GetActions()

Kind: Method

public static System.String[] GetActions()()

Summary

Gets the registered action names.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

A stable, ordinally sorted array of action names.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap

HasAction(System.String)

Kind: Method

public static System.Boolean HasAction(System.String)(System.String action)

Summary

Checks whether an action exists.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • action: The action name to check.

Returns

true if the action exists; otherwise, false.

Exceptions

  • System.ArgumentException: Thrown when action is empty.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputMap

Clone this wiki locally