Struct InputInteractionSignature
What drives a binding, reduced to the little that conflict detection needs.
Implements
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public readonly struct InputInteractionSignature : IEquatable<InputInteractionSignature>
Remarks
Four bytes on InputConflictRecord, which is a size-constrained struct with one instance per binding in the project. The alternative, carrying the authored string, would cost twice as much and would mean parsing on every comparison; the conflict scan is measured against an allocation budget that forbids it, and it only ever asks whether two signatures are disjoint.
The action events do now report an interaction, but they report the one that actually drove a fire rather than what a binding declares, and they resolve it from the live interaction instance. That is a different question from the one this struct answers, so it needs nothing from here beyond the shared InputInteractionKind vocabulary. See DECISIONS entry 056.
The duration is held in milliseconds rather than seconds, which is what makes the boundary case exact. Rounding to the nearest millisecond means two durations that round equal really are equal for this purpose, so a strict integer comparison expresses "the tap window closes at or before the hold window opens" with no float comparison in the predicate at all.
Constructors
InputInteractionSignature(InputInteractionKind, int, bool)
Packs a signature.
Declaration
public InputInteractionSignature(InputInteractionKind kind, int durationMilliseconds, bool hasCustomPressPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| InputInteractionKind | kind | Which state machine drives the binding. |
| int | durationMilliseconds | Its duration, clamped into the packed range. |
| bool | hasCustomPressPoint | Whether the binding set its own press point. |
Fields
MAXIMUM_DURATION_MILLISECONDS
Longest duration the packed form can hold, in milliseconds.
Declaration
public const int MAXIMUM_DURATION_MILLISECONDS = 16777215
Field Value
| Type | Description |
|---|---|
| int |
Properties
Default
Gets a signature meaning "no interaction was authored".
Declaration
public static InputInteractionSignature Default { get; }
Property Value
| Type | Description |
|---|---|
| InputInteractionSignature |
DurationMilliseconds
Gets the interaction's duration in milliseconds, with the project default already substituted when none was authored.
Declaration
public int DurationMilliseconds { get; }
Property Value
| Type | Description |
|---|---|
| int |
HasCustomPressPoint
Gets whether the binding set its own press point rather than taking the project's.
Declaration
public bool HasCustomPressPoint { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Recorded because it is what breaks the timing argument. Every interaction starts its clock when the control crosses its own press point, so two interactions on one analog control with different press points start counting at different moments, and a comparison of their durations no longer says which finishes first.
Kind
Gets which state machine drives the binding.
Declaration
public InputInteractionKind Kind { get; }
Property Value
| Type | Description |
|---|---|
| InputInteractionKind |
Packed
Gets the packed form, for a test that wants to assert the layout.
Declaration
public uint Packed { get; }
Property Value
| Type | Description |
|---|---|
| uint |
Methods
AreProvablyDisjoint(in InputInteractionSignature, in InputInteractionSignature)
Reports whether two bindings on one control can never both perform from one gesture.
Declaration
public static bool AreProvablyDisjoint(in InputInteractionSignature a, in InputInteractionSignature b)
Parameters
| Type | Name | Description |
|---|---|---|
| InputInteractionSignature | a | One binding's signature. |
| InputInteractionSignature | b | The other's. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Deliberately narrow. The question is not whether the two interactions differ but whether their state machines are provably exclusive in time, and only two pairs are. Answering "not disjoint" costs a conflict warning that may be unnecessary; answering "disjoint" wrongly hides a collision that really happens, which is the worse failure and the one this errs away from.
Tap against Hold. A tap performs on release when the press was shorter than its duration, and cancels itself on its own timeout so it cannot restart mid-press. A hold performs at its duration while the control is still down. Both would need a release inside the window between the hold's threshold and the tap's, which is empty when the tap's duration is the shorter one.
Tap against slow tap. Both perform on the same release, one when the press was shorter than its duration and the other when it was longer, so they overlap only if the tap's window extends past where the slow tap's begins.
Everything else overlaps, and the near misses are worth naming because each looks exclusive. A hold and a slow tap both fire on one long press and release, the hold at its threshold and the slow tap when the control comes up. A tap and a multi-tap both fire on a double tap, the tap on the first release. A press is contained in every gesture that performs a tap or a hold, and the release-only variant still starts on the press. And an unauthored interaction is not the absence of one: it is Unity's default, which for a button performs the moment the control goes down.
Equals(InputInteractionSignature)
Declaration
public bool Equals(InputInteractionSignature other)
Parameters
| Type | Name | Description |
|---|---|---|
| InputInteractionSignature | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |