Vixen
02b45cc4
csharp
public sealed class InputActions

A .vxinput asset, loaded and ready to read.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

One instance is one player. Two players sharing a couch load the same asset twice and set a different GamepadSlot on each, which is the whole of local multiplayer: the bindings are identical, the device they read is not, and nothing about the asset has to know how many players there are.

Nothing here polls a device. Update is called once a frame by whatever owns the loop — the ECS InputUpdateSystem in a game, a test directly — after the frame's events have been submitted to the InputDeviceSet. Every action then holds a value that does not change until the next update, which is what makes reading input from a fixed-step simulation meaningful.

Fields and properties (8)

  • public InputActionAssetData Data

    What the asset said.

  • public string Name

    Its name, which is what the generated accessor class is called.

  • public IReadOnlyList<InputActionMap> Maps

    Its action maps.

  • public IReadOnlyList<InputControlScheme> ControlSchemes

    Its control schemes.

  • public int GamepadSlot

    Which entry of Gamepads this instance's gamepad bindings read.

  • public InputControlScheme? ActiveControlScheme

    The scheme in force, or for "every binding".

  • public bool AutoSwitchControlSchemes

    Whether to follow the player onto whichever device they pick up.

  • public InputActionMap this[string name]

    Finds a map by name, case-insensitively.

Events (1)

  • public Action<InputControlScheme?>? ControlSchemeChanged

    Raised when ActiveControlScheme changes.

Methods (16)

  • public static InputActions Load(string text, string name = "InputActions")

    Loads an asset from .vxinput text.

  • public static bool TryLoad(string text, out InputActions? actions, out IReadOnlyList<InputAssetDiagnostic> diagnostics, string name = "InputActions")

    Loads an asset, reporting what was wrong with it rather than throwing.

  • public static InputActions From(InputActionAssetData data)

    Builds an asset from a model that is already in memory.

  • public bool TryFindMap(string? name, out InputActionMap? map)

    Finds a map by name, case-insensitively.

  • public bool TryFindAction(string? path, out InputAction? action)

    Finds an action by its full name, Player/Move.

  • public InputAction FindAction(string path)

    Finds an action by its full name.

  • public void Enable()

    Enables every map.

  • public void Disable()

    Disables every map.

  • public bool SetControlScheme(string? name)

    Chooses the control scheme by name.

  • public void Update(InputDeviceSet devices, GameTime time)

    Reads every enabled action.

  • public void Update(InputDeviceSet devices, double time)

    Reads every enabled action.

  • public void FindConflicts(InputControl control, List<InputBindingConflict> into, InputAction? except = null, string? scheme = null)

    Every action already bound to a control.

  • public string SaveBindingOverrides()

    Writes every binding the player has changed.

  • public int LoadBindingOverrides(string? text)

    Applies a document written by SaveBindingOverrides.

  • public void RemoveAllBindingOverrides()

    Puts every binding back to what the asset says.

  • public override string ToString()

    Returns a string that represents the current object.

Used by (10)

  • PlayerRigThirdPersonShooter
  • GeneratedAccessorTestsVixen.Input.Tests
  • InputActionMapVixen.Input
  • InputActionTestsVixen.Input.Tests
  • InputRebindingOperationVixen.Input
  • InputRebindingTestsVixen.Input.Tests
  • InputServiceVixen.Input
  • PlayerInputTestsVixen.Engine.Tests
  • SampleVixen.Input.Tests
  • SampleInputVixen.Input.Tests