Skip to content

InputBinding

namespace Griff.Input;
public struct InputBinding

A key, mouse button or gamepad button that triggers an action (see IInput.Bind). Any of the three converts to one, so a list of bindings reads Key.Space, GamepadButton.A.

public GamepadButton? Gamepad { get; }
public Key? Key { get; }
public MouseButton? Mouse { get; }
public override bool Equals(object obj)
public bool Equals(InputBinding other)
public override int GetHashCode()
public override string ToString()

“Space”, “Mouse Left” or “Gamepad A”: what a controls screen can show.

public static bool TryParse(string? text, out InputBinding binding)

Reads what ToString writes, e.g. “Gamepad A”. False for anything else.