Class InputActionMap¶
Namespace: Apogee.Input
Assembly: Apogee.Input.dll
Every action the player can bind, where each works (its contexts) and what it is bound to. Contexts are names the game chooses (world,
on_foot, vehicle, menu); situations say which are active together, so two actions that can never be active at once may share an input.
A
public sealed class InputActionMap : EngineObject
Inheritance¶
object ← EngineObject ← InputActionMap
Inherited Members¶
EngineObject.IsAdopted, EngineObject.Handle, EngineObject.IsDestroyed, EngineObject.Class, EngineObject.Adopt(), EngineObject.TryGet(SlotHandle, out EngineObject), EngineObject.Destroy(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
Actions¶
The actions, in the order they were added.
public IReadOnlyList<InputAction> Actions { get; }
Property Value¶
Class¶
What the registry knows about this object's class.
public override ClassInfo Class { get; }
Property Value¶
Methods¶
AddAction(string, string[], string[], bool, string)¶
Adds an action, bound to defaults (binding texts: see
public void AddAction(string id, string[] contexts, string[] defaults, bool analog = false, string help = "")
Parameters¶
id string
contexts string[]
defaults string[]
analog bool
help string
AddSituation(string[])¶
Says that these contexts are active together (a situation). Without any, two actions clash when they share a context.
public void AddSituation(string[] contexts)
Parameters¶
contexts string[]
AllConflicts()¶
Every clash among the current bindings, each pair once.
public IReadOnlyList<BindingConflict> AllConflicts()
Returns¶
IReadOnlyList<BindingConflict>
BindingError(string)¶
Why a binding text does not read, or an empty string when it does.
public static string BindingError(string text)
Parameters¶
text string
Returns¶
Conflicts(string, Binding)¶
The actions that can be active together with id and are bound to binding as well.
public IReadOnlyList<string> Conflicts(string id, Binding binding)
Parameters¶
id string
binding Binding
Returns¶
ContextsOverlap(string[], string[])¶
True when an action of a and one of b can be active at the same time.
public bool ContextsOverlap(string[] a, string[] b)
Parameters¶
a string[]
b string[]
Returns¶
Find(string)¶
public InputAction? Find(string id)
Parameters¶
id string
Returns¶
GetActions()¶
The ids of the actions, in the order they were added.
public string[] GetActions()
Returns¶
string[]
GetAllConflicts()¶
Every clash as a line of three tab-separated fields: the action, the other action and the binding.
public string[] GetAllConflicts()
Returns¶
string[]
GetBindings(string)¶
public string[] GetBindings(string id)
Parameters¶
id string
Returns¶
string[]
GetConflicts(string, string)¶
The actions that would clash if id were bound to this text.
public string[] GetConflicts(string id, string binding)
Parameters¶
id string
binding string
Returns¶
string[]
GetContexts(string)¶
public string[] GetContexts(string id)
Parameters¶
id string
Returns¶
string[]
GetDefaults(string)¶
public string[] GetDefaults(string id)
Parameters¶
id string
Returns¶
string[]
GetHelp(string)¶
What an action is for, as it was added.
public string GetHelp(string id)
Parameters¶
id string
Returns¶
HasAction(string)¶
public bool HasAction(string id)
Parameters¶
id string
Returns¶
IsAnalog(string)¶
public bool IsAnalog(string id)
Parameters¶
id string
Returns¶
Load(IReadOnlyDictionary<string, string[]>)¶
Applies what
public string[] Load(IReadOnlyDictionary<string, string[]> saved)
Parameters¶
saved IReadOnlyDictionary<string, string[]>
Returns¶
string[]
LoadSaved(IReadOnlyDictionary<string, string[]>)¶
Applies saved bindings (
public string[] LoadSaved(IReadOnlyDictionary<string, string[]> saved)
Parameters¶
saved IReadOnlyDictionary<string, string[]>
Returns¶
string[]
LoadText(string)¶
Applies
public string[] LoadText(string text)
Parameters¶
text string
Returns¶
string[]
NormalizeBinding(string)¶
The binding text as it would be saved: the trigger, the modifiers and the input spelled the way this class writes them. Throws (a script error) on text that does not read.
public static string NormalizeBinding(string text)
Parameters¶
text string
Returns¶
ParseBinding(string)¶
A binding's parts: the input, its modifiers, its trigger. Throws (a script error) on text that does not read.
public static (string Input, Modifiers Modifiers, Trigger Trigger) ParseBinding(string text)
Parameters¶
text string
Returns¶
(string Input, Modifiers Modifiers, Trigger Trigger)
Reset(string)¶
public void Reset(string id)
Parameters¶
id string
ResetAll()¶
Puts every defined action back to its defaults. Saved bindings of actions that are not defined (yet) are kept.
public void ResetAll()
Save()¶
The bindings that differ from the defaults, by action id: what a game stores in the player's settings. It includes the saved bindings of actions that are not defined (
public IReadOnlyDictionary<string, string[]> Save()
Returns¶
IReadOnlyDictionary<string, string[]>
SaveText()¶
lights = Hold L | Joy RB (an action with no binding has nothing after the equals sign).
public string SaveText()
Returns¶
SetBindings(string, string[])¶
Rebinds an action. Throws (a script error) on a binding that does not read.
public void SetBindings(string id, string[] bindings)
Parameters¶
id string
bindings string[]
BindingsChanged¶
Raised after any rebinding:
public event Action? BindingsChanged