Interface IInputControlAliasResolver
Rewrites a control path to a canonical spelling, so two paths naming one physical control compare equal.
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public interface IInputControlAliasResolver
Remarks
The Input System lets one control answer to several names.
<Gamepad>/buttonSouth, <Gamepad>/a and
<Gamepad>/cross are one button, and a device resolves all three to the
same control. Nothing rewrites the authored string, though:
InputBinding.effectivePath is the override or the authored path verbatim, and
alias resolution happens only when a binding is matched against a live device, where
it yields a control list rather than a path. Two bindings spelled differently
therefore look unrelated to any rule that compares paths, including the conflict
engine's.
Implementations close that gap by mapping every spelling onto one. The contract is deliberately narrow:
-
Total. Never throws, never returns
null. A path naming an unknown device, a malformed path and an empty string are all answered, not rejected. - Idempotent. Normalizing an already-canonical path returns it unchanged, so a caller may normalize twice without changing the result.
- Conservative. When the answer is not certain, return the input. A wrong rewrite invents a conflict between controls that are genuinely separate, which is a false warning on correct authoring; a missing rewrite only leaves the behavior as it already was.
Equivalence is within one device layout only. <Gamepad>/a and
<DualShockGamepad>/cross reach the same button on a DualShock, but binding
a generic path alongside a device-specific one is a deliberate and correct pattern, so
reporting it as a collision would be a false positive. That case belongs to validation,
which can present it as advice rather than as a conflict.
Properties
Version
Gets a counter incremented whenever the resolver's answers may have changed.
Declaration
int Version { get; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Callers that cache normalized paths compare this against the value they cached with, and rebuild when it differs. A resolver whose answers are fixed for its lifetime reports a constant.
Methods
Normalize(string)
Rewrites a control path to its canonical spelling.
Declaration
string Normalize(string controlPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | controlPath | The path to normalize, for example |
Returns
| Type | Description |
|---|---|
| string | The canonical path, or the input unchanged when it is already canonical or cannot be
resolved. Never |