Vixen
02b45cc4
csharp
public static class InputControlPath

The text form of an InputControl: <Gamepad>/leftStick/x.

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

Remarks

Text, because it has to survive things a struct cannot. A binding lives in a .vxinput under version control, in a player's saved rebindings, and in a diff someone reviews — all places where (3, 32, 0) is unreadable and, worse, silently wrong the day a control is inserted into the middle of an enum. The path is the stable name; the struct is the fast one.

A path may name a pair. <Gamepad>/leftStick is a two-dimensional control and binding it to a vector action should not require the author to write two bindings and a composite. So parsing yields an X control and, where the path names a two-dimensional thing, a Y as well.

Parsing is case-insensitive and formatting is camelCase, which is the same rule the rest of the engine's authored files follow.

Methods (5)

  • public static bool TryParse(string? path, out InputControl control)

    Reads a path.

  • public static bool TryParse(string? path, out InputControl x, out InputControl y)

    Reads a path, which may name a two-dimensional control.

  • public static string Format(InputControl control)

    Writes a control as a path.

  • public static string Format(InputControl x, InputControl y)

    Writes a pair of controls as the one path that names both.

  • public static string Describe(InputControl control)

    What to show a player who is looking at this binding.

Used by (7)

  • InputBindingVixen.Input
  • InputBindingConflictVixen.Input
  • InputBindingPartVixen.Input
  • InputControlVixen.Input
  • InputControlPathTestsVixen.Input.Tests
  • InputRebindingOperationVixen.Input
  • InputActionsViewVixen.Editor.AssetEditors