Class ScyllaInputBinding
A snapshot wrapper around a single Unity InputBinding, providing convenient
access to binding metadata, override state, display strings, and device type
classification.
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public class ScyllaInputBinding
Remarks
Each ScyllaInputBinding corresponds to one entry in the flat
InputAction.bindings list of the underlying Unity action. Unity's
binding list uses a flat structure even for composite bindings: a composite is
represented as a "container" entry (where IsComposite is
true) followed immediately by the individual part entries (where
IsPartOfComposite is true). Both the container and its
parts have separate ScyllaInputBinding instances, and both are
included in Bindings.
The Path property holds the design-time path exactly as authored
in the Unity asset (e.g., "<Keyboard>/space"). The
EffectivePath reflects any runtime override applied via rebinding;
it equals Path when no override is active.
Instances are created and owned by ScyllaInputAction. Call RefreshBindings() after a rebind operation to rebuild the list with updated EffectivePath and OverridePath values. Alternatively, call Refresh(InputBinding) on an existing instance to update it in place.
Constructors
ScyllaInputBinding(InputBinding, int, string)
Initializes a new ScyllaInputBinding from a Unity
InputBinding and associated metadata.
Declaration
public ScyllaInputBinding(InputBinding unityBinding, int bindingIndex, string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| InputBinding | unityBinding | The Unity |
| int | bindingIndex | The zero-based index of this binding within the owning action's flat binding
list ( |
| string | actionID | The |
Remarks
The DisplayString is generated immediately from the effective
path via InputControlPath.ToHumanReadableString with the
OmitDevice option, so it reads as a short label like "Space"
rather than "Keyboard/Space".
Properties
ActionID
Gets the ActionID of the ScyllaInputAction that owns
this binding.
Declaration
public string ActionID { get; }
Property Value
| Type | Description |
|---|---|
| string | Never |
BindingID
Gets the stable GUID that uniquely identifies this binding within the
InputActionAsset.
Declaration
public Guid BindingID { get; }
Property Value
| Type | Description |
|---|---|
| Guid | Taken directly from |
BindingIndex
Gets the zero-based index of this binding within the owning action's flat binding list.
Declaration
public int BindingIndex { get; }
Property Value
| Type | Description |
|---|---|
| int | Matches the |
DisplayString
Gets the human-readable display label for this binding generated at construction time (or after the last Refresh(InputBinding)).
Declaration
public string DisplayString { get; }
Property Value
| Type | Description |
|---|---|
| string | Derived from EffectivePath using
|
EffectiveInteractions
Gets the interactions actually in force, which an override replaces rather than adds to.
Declaration
public string EffectiveInteractions { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Mirrored here for the same reason EffectivePath is: reading it off the Unity binding means copying a large struct, and a value re-read on Refresh(InputBinding) is the only one that survives a rebind.
Not the whole story for a composite part, which ignores its own interactions and
takes its container's. Callers that need the effective answer should go through
InputInteractionResolver.ResolveForBinding rather than reading this directly.
EffectivePath
Gets the control path currently in effect after applying any runtime override.
Declaration
public string EffectivePath { get; }
Property Value
| Type | Description |
|---|---|
| string | Equals Path when no override is active. When an override has been applied via rebinding, this reflects the new path (e.g., the player's custom key assignment). Use this property for all queries that need to reflect the player's current configuration. |
Groups
Gets the semicolon-separated list of control scheme group names this binding belongs to.
Declaration
public string Groups { get; }
Property Value
| Type | Description |
|---|---|
| string | For example, |
HasOverride
Gets a value indicating whether a runtime override path has been applied to this binding (e.g., via a rebind operation).
Declaration
public bool HasOverride { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Remarks
The test is against null rather than emptiness, and the difference matters.
Unity uses null to mean "no override" and an empty string to mean
"deliberately unbound", and its own InputBinding.hasOverrides makes the same
distinction. Treating an empty override as no override would report a binding the
player has cleared as untouched, which in turn would drop it from a saved profile
and quietly restore the asset default on the next load.
So a cleared binding has HasOverride true and both
OverridePath and EffectivePath empty.
Interactions
Gets the interactions authored on this binding, before any override.
Declaration
public string Interactions { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsComposite
Gets a value indicating whether this binding is a composite container entry (the header row before the individual part rows in the flat binding list).
Declaration
public bool IsComposite { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
IsPartOfComposite
Gets a value indicating whether this binding is one of the part entries within a composite binding group (i.e., it follows a composite container entry in the flat binding list).
Declaration
public bool IsPartOfComposite { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Name
Gets the optional name of this binding entry within a composite.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string | For composite parts, this is the role name assigned in the Unity asset
(e.g., |
OverridePath
Gets the runtime override path that replaces the design-time Path, or an empty string when there is no override.
Declaration
public string OverridePath { get; }
Property Value
| Type | Description |
|---|---|
| string | Taken from |
Path
Gets the design-time control path for this binding as authored in the Unity
asset (e.g., "<Keyboard>/space").
Declaration
public string Path { get; }
Property Value
| Type | Description |
|---|---|
| string | Taken from |
UnityBinding
Gets the underlying Unity InputBinding struct that this object wraps.
Declaration
public InputBinding UnityBinding { get; }
Property Value
| Type | Description |
|---|---|
| InputBinding | A copy of the |
Methods
BelongsToGroup(string)
Determines whether this binding belongs to the specified control scheme group.
Declaration
public bool BelongsToGroup(string group)
Parameters
| Type | Name | Description |
|---|---|---|
| string | group | The control scheme group name to check (e.g., |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Compares whole entries of the semicolon-separated Groups string,
case-insensitively and ignoring surrounding whitespace. A binding with
Groups = "Keyboard;Mouse" returns true for both "Keyboard"
and "Mouse", and a binding in "Keyboard&Mouse" returns
false for "Keyboard", because that is a different group.
This matches the Input System, which resolves a binding mask by comparing the two group lists entry by entry rather than as text. An earlier version of this method tested for a substring, which made a group name a prefix of another name silently select that other group's bindings as well.
GetDeviceType()
Returns the InputDeviceType that this binding targets, inferred from the device component of its EffectivePath.
Declaration
public InputDeviceType GetDeviceType()
Returns
| Type | Description |
|---|---|
| InputDeviceType | The InputDeviceType matching the device prefix in EffectivePath, or Unknown if the path is empty or does not match a recognised device token. |
Remarks
Delegates to GetDeviceTypeFromPath(string), which parses
well-known device tokens such as <Keyboard>,
<Gamepad>, <Mouse>, <Touchscreen>,
<Joystick>, and <Pen>.
GetDisplayString(HumanReadableStringOptions)
Returns the human-readable display string for this binding's effective path, formatted according to the specified options.
Declaration
public string GetDisplayString(InputControlPath.HumanReadableStringOptions options = HumanReadableStringOptions.OmitDevice)
Parameters
| Type | Name | Description |
|---|---|---|
| InputControlPath.HumanReadableStringOptions | options | Formatting options that control the output style. Defaults to
|
Returns
| Type | Description |
|---|---|
| string | A formatted, human-readable label for this binding's effective path (e.g.,
|
Remarks
Unlike the cached DisplayString property, this method always
calls InputControlPath.ToHumanReadableString at the time of the call,
allowing different formatting options to be applied on demand.
Refresh(InputBinding)
Updates all mutable properties of this binding from the provided Unity
InputBinding struct, reflecting any rebind changes.
Declaration
public void Refresh(InputBinding unityBinding)
Parameters
| Type | Name | Description |
|---|---|---|
| InputBinding | unityBinding | The updated Unity |
Remarks
Call this method after a rebind operation to keep the Scylla binding wrapper in sync with the Unity-side state. Refreshes UnityBinding, Path, EffectivePath, HasOverride, OverridePath, and DisplayString. Read-only properties (BindingID, BindingIndex, ActionID, Name, Groups, IsComposite, IsPartOfComposite) are not changed.
ToString()
Returns a human-readable string representation of this binding, including its owning action ID, binding index, display string, and raw path.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string in the form |