public sealed class InputRebindingOperation"Press the key you want to use for this."
No guide page documents this yet — the page shows what the code says about itself.
Remarks
This is what the action model exists for. Everything else in this assembly can be approximated by polling a device; rebinding cannot, because it needs to know what every action is bound to, which bindings belong to the scheme the player is configuring, and how to write the answer somewhere that survives a patch.
The actions are disabled while it runs, and that is not a nicety: the key the player presses to choose a new "jump" would otherwise also make the character jump, and the menu behind the dialog would act on every candidate.
A conflict stops the operation rather than resolving it. Whether binding "crouch" to the key "jump" already uses should refuse, swap the two, or be allowed is a game's decision — a shooter and a strategy game answer it differently — so the operation reports Blocked with the conflicts listed and waits for ApplyAnyway or Cancel.
Fields and properties (12)
public InputActions ActionsThe asset the action belongs to.
public InputAction ActionThe action being rebound.
public int BindingIndexWhich of its bindings.
public int PartIndexWhich composite part, or -1.
public InputRebindingState StateWhere the operation has got to.
public InputControl SelectedControlThe control the player chose, once there is one.
public IReadOnlyList<InputBindingConflict> ConflictsThe actions already bound to SelectedControl.
public float ThresholdHow far an analogue control must move before it counts as the answer.
public float SettleTimeHow long a control must stay actuated before it is accepted, in seconds.
public bool AllowConflictsWhether a control already bound elsewhere is accepted without asking.
public bool DisableActionsWhileListeningWhether to turn the asset's maps off while listening.
public string? ConflictSchemeWhich scheme's bindings conflicts are looked for in, or for all.
Events (2)
public Action<InputRebindingOperation>? FinishedRaised when the operation reaches a terminal state, whichever one.
public Action<InputRebindingOperation>? CandidateSelectedRaised each time a candidate control is accepted, before conflicts are considered.
Methods (7)
public InputRebindingOperation(InputActions actions, InputAction action, int bindingIndex, int partIndex = -1)Prepares a rebinding.
public InputRebindingOperation Excluding(InputControl control)Refuses a control — Escape, the pointer, whatever the game reserves.
public InputRebindingOperation WithDevice(InputDeviceKind kind)Limits the operation to one family of device.
public InputRebindingOperation Start()Starts listening.
public void Update(InputDeviceSet devices, double time)Looks at what is actuated and decides whether it is the answer.
public void ApplyAnyway()Applies a binding that conflicts with another, having asked the player.
public void Cancel()Gives up, leaving the binding as it was.
Used by (2)
- InputRebindingTestsVixen.Input.Tests
- InputServiceVixen.Input