Struct Binding¶
Namespace: Apogee.Input
Assembly: Apogee.Input.dll
What an action is bound to, in the text form players edit: [Hold |Double ][Ctrl+][Shift+][Alt+]input. Keys go by their position on a US
QWERTY keyboard (W, Tab, F1, BracketLeft…: Mouse Left, Mouse Right, Mouse Middle, Mouse Wheel Up, Mouse Wheel Down, Mouse Back, Mouse Forward and the motion
Mouse X- … Mouse Y+; gamepad inputs are Joy A … Joy Right (Xbox names), the sticks Joy LX- … Joy RY+ (Y+ is down) and
the triggers Joy LT, Joy RT. Names are case-insensitive when read and written the way this lists them.
public readonly record struct Binding : IEquatable<Binding>
Implements¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors¶
Binding(string, Modifiers, Trigger)¶
What an action is bound to, in the text form players edit: [Hold |Double ][Ctrl+][Shift+][Alt+]input. Keys go by their position on a US
QWERTY keyboard (W, Tab, F1, BracketLeft…: Mouse Left, Mouse Right, Mouse Middle, Mouse Wheel Up, Mouse Wheel Down, Mouse Back, Mouse Forward and the motion
Mouse X- … Mouse Y+; gamepad inputs are Joy A … Joy Right (Xbox names), the sticks Joy LX- … Joy RY+ (Y+ is down) and
the triggers Joy LT, Joy RT. Names are case-insensitive when read and written the way this lists them.
public Binding(string Input, Modifiers Modifiers, Trigger Trigger)
Parameters¶
Input string
Modifiers Modifiers
Trigger Trigger
Properties¶
GamepadInputs¶
Every gamepad input, as it is written.
public static IReadOnlyList<string> GamepadInputs { get; }
Property Value¶
Input¶
public string Input { get; init; }
Property Value¶
Modifiers¶
public Modifiers Modifiers { get; init; }
Property Value¶
MouseInputs¶
Every mouse input, as it is written.
public static IReadOnlyList<string> MouseInputs { get; }
Property Value¶
Trigger¶
public Trigger Trigger { get; init; }
Property Value¶
Methods¶
DeviceOf(string)¶
public static InputDevice DeviceOf(string input)
Parameters¶
input string
Returns¶
IsAxis(string)¶
A stick direction, a mouse motion direction or a trigger: inputs with a strength between 0 and 1 (more, for the mouse), not just down or up.
public static bool IsAxis(string input)
Parameters¶
input string
Returns¶
IsTrigger(string)¶
A gamepad trigger: an axis that only goes one way, so its name has no sign.
public static bool IsTrigger(string input)
Parameters¶
input string
Returns¶
Parse(string)¶
Reads the text form, or throws a
public static Binding Parse(string text)
Parameters¶
text string
Returns¶
Prefix(Modifiers)¶
public static string Prefix(Modifiers modifiers)
Parameters¶
modifiers Modifiers
Returns¶
Prefix(Trigger)¶
public static string Prefix(Trigger trigger)
Parameters¶
trigger Trigger
Returns¶
ToString()¶
The text form: Hold Ctrl+Shift+L.
public override string ToString()
Returns¶
TryParse(string, out Binding, out string)¶
Reads the text form; error says what is wrong when it returns false.
public static bool TryParse(string text, out Binding binding, out string error)
Parameters¶
text string
binding Binding
error string