Scylla Framework
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Scylla.Input
      • AutoResolveChange
      • AutoResolveResult
      • BindingConflict
      • BindingStorageSettings
      • BindingStorageType
      • BridgeSettings
      • BufferedInput
      • ConfigActionEntry
      • ConfigBindingEntry
      • ConfigConflict
      • ConfigSchemeGroup
      • ContextValidationMessage
      • ContextValidationSeverity
      • ControlScheme
      • ControlSchemeChangedEvent
      • ControlSchemeManager
      • ControlSchemeType
      • GamepadButton
      • GamepadType
      • IBindingStorage
      • IControlSchemeManager
      • IInputActionManager
      • IInputBindingManager
      • IInputBridgeManager
      • IInputBufferManager
      • IInputContextManager
      • IInputHintsManager
      • IInputListener
      • IScyllaInputBridge
      • InputActionCanceledEvent
      • InputActionManager
      • InputActionPerformedEvent
      • InputActionStartedEvent
      • InputBindingManager
      • InputBindingsLoadedEvent
      • InputBindingsSavedEvent
      • InputBridgeManager
      • InputBridgeQueryMode
      • InputBufferConsumedEvent
      • InputBufferManager
      • InputBufferedEvent
      • InputConflictResolution
      • InputContext
      • InputContextChangedEvent
      • InputContextDefinition
      • InputContextManager
      • InputContextPoppedEvent
      • InputContextPushedEvent
      • InputDeviceChangedEvent
      • InputDeviceConnectedEvent
      • InputDeviceDisconnectedEvent
      • InputDeviceType
      • InputDeviceUtil
      • InputDisabledEvent
      • InputEnabledEvent
      • InputEventType
      • InputHint
      • InputHintChangedEvent
      • InputHintsManager
      • InputIconSet
      • InputIconSet.IconMapping
      • InputIconSetChangedEvent
      • InputLoggingSettings
      • InputRebindCancelledEvent
      • InputRebindCompletedEvent
      • InputRebindManager
      • InputRebindOperation
      • InputRebindStartedEvent
      • InputRebindUtils
      • JSONFileBindingStorage
      • ManagedRebindCancelledEvent
      • ManagedRebindCompletedEvent
      • ManagedRebindDataRefreshedEvent
      • ManagedRebindStartedEvent
      • PlayerPrefsBindingStorage
      • RebindMode
      • RebindSettings
      • ScyllaInput
      • ScyllaInput.Meta
      • ScyllaInputAction
      • ScyllaInputActionMap
      • ScyllaInputBinding
      • ScyllaInputConfiguration
      • ScyllaInputContextConfiguration
      • ScyllaKey
      • ScyllaKeyConverter
      • ScyllaModifier
      • UnityInputSystemBridge
    • Scylla.Input.Editor
      • ControlSchemeDrawer
      • DeviceStatusWidget
      • IconMappingDrawer
      • InputIconSetEditor
      • ScyllaInputConfigurationEditor
      • ScyllaInputContextConfigurationEditor
      • ScyllaInputDependencyProvider
      • ScyllaInputEditor
      • ScyllaInputMenuItems
      • ScyllaInputWizard

    Struct BufferedInput

    An immutable snapshot of a single buffered input event, capturing the action identifier, value, timestamp, and originating device at the moment the input occurred.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Scylla.Input
    Assembly: ScyllaInput.dll
    Syntax
    public readonly struct BufferedInput
    Remarks

    InputBufferManager stores these entries in a ring buffer. Each entry ages in real time via the Age property and is considered expired once its age exceeds the configured buffer window (see DefaultBufferWindow or per-action overrides).

    BufferedInput is a readonly struct. All copies share the same data; there is no mutable state. Use Invalid as a sentinel for "no input found" results from peek and consume operations.

    The timestamp is recorded using Time.realtimeSinceStartupAsDouble, which continues to advance while the game is paused and is unaffected by time scale. This ensures that buffered inputs age correctly regardless of pause state or slow motion effects.

    Constructors

    BufferedInput(string, float, double, InputDevice, InputDeviceType)

    Initializes a new BufferedInput with full metadata.

    Declaration
    public BufferedInput(string actionID, float value, double timestamp, InputDevice device, InputDeviceType deviceType)
    Parameters
    Type Name Description
    string actionID

    The identifier of the action that was performed. Should be non-null and non-empty for a valid entry; pass null only when constructing the Invalid sentinel.

    float value

    The input value at the time of the action; typically 1.0 for a button press or an analog reading in [0, 1] for triggers and axes.

    double timestamp

    The value of Time.realtimeSinceStartupAsDouble at the exact moment the action was detected. Used by Age to compute how long ago this input occurred.

    InputDevice device

    The Unity Input System device that generated the action, or null if device tracking is not required.

    InputDeviceType deviceType

    The InputDeviceType category of device. Pass Unknown when no device is provided.

    Properties

    ActionID

    Gets the identifier of the action that was buffered.

    Declaration
    public string ActionID { get; }
    Property Value
    Type Description
    string

    The same string that was passed to BufferAction(string, float) when this entry was created. Never null on a valid entry; will be null on the Invalid sentinel.

    Age

    Gets the elapsed real time in seconds since this input was recorded.

    Declaration
    public float Age { get; }
    Property Value
    Type Description
    float

    The difference between Time.realtimeSinceStartupAsDouble at the current moment and Timestamp, cast to float. Monotonically increases each frame. Use IsExpired(float) or IsWithinWindow(float) to compare against a time window rather than reading this property directly.

    Device

    Gets the Unity Input System device that generated this input, if known.

    Declaration
    public InputDevice Device { get; }
    Property Value
    Type Description
    InputDevice

    The originating UnityEngine.InputSystem.InputDevice, or null if device information was not provided when the input was buffered (e.g., when using the BufferAction(string, float) overload without a device argument). Also null on the Invalid sentinel.

    DeviceType

    Gets the InputDeviceType category of the device that generated this input.

    Declaration
    public InputDeviceType DeviceType { get; }
    Property Value
    Type Description
    InputDeviceType

    The device category inferred at buffer time, or Unknown if no device was provided or if the device could not be classified.

    Invalid

    Returns a sentinel BufferedInput that represents the absence of a valid buffered input event.

    Declaration
    public static BufferedInput Invalid { get; }
    Property Value
    Type Description
    BufferedInput

    A BufferedInput with a null ActionID, a Value of 0f, a Timestamp of 0.0, a null Device, and a DeviceType of Unknown. IsValid returns false on this instance. Use it as a safe default when a consume or peek operation finds no matching entry.

    IsValid

    Gets whether this entry represents a real buffered input (as opposed to the Invalid sentinel).

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    bool

    true if ActionID is non-null and non-empty; false for the Invalid sentinel returned by failed peek or consume operations.

    Timestamp

    Gets the real-time timestamp at which this input was recorded.

    Declaration
    public double Timestamp { get; }
    Property Value
    Type Description
    double

    The value of Time.realtimeSinceStartupAsDouble at the moment BufferAction(string, float) was called. Uses real time so the entry ages correctly regardless of time scale or pause state. 0.0 on the Invalid sentinel.

    Value

    Gets the magnitude of the input at the moment it was buffered.

    Declaration
    public float Value { get; }
    Property Value
    Type Description
    float

    1.0 for a digital button press (the default when no value is provided), or the raw analog reading (e.g., trigger pressure in [0, 1]) for analog actions. 0f on the Invalid sentinel.

    Methods

    IsExpired(float)

    Returns whether this buffered input is older than the given time window and should therefore no longer be considered valid for consumption.

    Declaration
    public bool IsExpired(float windowSeconds)
    Parameters
    Type Name Description
    float windowSeconds

    The maximum acceptable age in seconds. Must be a positive value; passing zero causes any input to be considered expired.

    Returns
    Type Description
    bool

    true if Age is strictly greater than windowSeconds; false if the input is still within the window.

    IsWithinWindow(float)

    Returns whether this buffered input is still within the given time window and remains eligible for consumption.

    Declaration
    public bool IsWithinWindow(float windowSeconds)
    Parameters
    Type Name Description
    float windowSeconds

    The maximum acceptable age in seconds. Must be a positive value; passing zero means only inputs that occurred in the exact current frame (age 0) are valid.

    Returns
    Type Description
    bool

    true if Age is less than or equal to windowSeconds; false if the input has expired.

    ToString()

    Returns a human-readable summary of this buffered input entry.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string in the format BufferedInput[ActionID, Value=X.XX, Age=X.XXXs, Device=DeviceType], useful for debug logging and diagnostics.

    Overrides
    ValueType.ToString()
    In this article
    Back to top Scylla Framework - Input Module API Documentation