InputBinding

One physical control wired to an action, together with what it contributes. A button binding's Value is the direction it pushes the action in — W contributes (0, 1) and S (0, −1) — and an axis binding's scales the reading, so (−1, 0) inverts it.

Properties

Path

(string) { get; set } = string.Empty: The control this binding reads, as a path such as Keyboard/W.

Value

(Vector2) { get; set } = Vector2.UnitX: What the control contributes when held, or what an axis reading is multiplied by.

PlayerIndex

(int) { get; set } = -1: The player slot a gamepad control must come from, or −1 for any attached gamepad.

Control

(InputControl) : The control Path names, reparsed whenever the path is rewritten.

Public Methods

For

public static InputBinding For(InputControl control, Vector2? value = null)

Builds a binding for one control.

Parameters:

  • control (InputControl): The control to read.
  • value (Vector2?): What it contributes; defaults to the positive X direction. (Default: null)

Returns: InputBinding

  • The binding.