Vixen
02b45cc4
csharp
public readonly record struct InputControl

One control on one family of device: the thing a binding points at.

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

Remarks

A control names a device family, not a device. Which physical gamepad a binding reads is settled by the reading asset's GamepadSlot, not written into the asset — otherwise a two-player game's second .vxinput would differ from the first only in a device id, and unplugging a pad would invalidate the file rather than the pairing.

Six bytes, no allocation, and comparable — which is what makes conflict detection a set operation rather than a string comparison over binding paths.

Fields and properties (6)

  • public InputDeviceKind Device

    Which family of device.

  • public ushort Code

    Which control, as the device family's own enum — InputKey, MouseControl, GamepadControl, TouchControl.

  • public byte Index

    Which instance: the finger for a touch control, and otherwise the slot the control's device is paired to. 0 is "whichever device the reading player has".

  • public static InputControl None

    No control. What an unresolved binding reads as.

  • public bool IsValid

    Whether this names a control at all.

  • public bool IsAnalogue

    Whether the control is analogue — a stick, a trigger, a motion delta, a position.

Methods (6)

Used by (18)

  • GamepadDeviceVixen.Input
  • IInputDeviceVixen.Input
  • InputActionVixen.Input
  • InputActionsVixen.Input
  • InputBindingVixen.Input
  • InputBindingConflictVixen.Input
  • InputBindingPartVixen.Input
  • InputControlPathVixen.Input
  • InputControlPathTestsVixen.Input.Tests
  • InputDeviceSetVixen.Input
  • InputKeyTestsVixen.Input.Tests
  • InputRebindingOperationVixen.Input
  • InputRebindingTestsVixen.Input.Tests
  • KeyboardDeviceVixen.Input
  • MouseDeviceVixen.Input
  • TouchDeviceVixen.Input
  • InputActionsViewVixen.Editor.AssetEditors
  • PlatformInputTestsVixen.App.Tests