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

    Interface IInputBridgeManager

    Manages the collection of registered IScyllaInputBridge instances and routes all input queries to the appropriate bridge based on the configured query strategy.

    Namespace: Scylla.Input
    Assembly: ScyllaInput.dll
    Syntax
    public interface IInputBridgeManager
    Remarks

    The bridge manager is the single point of access for all raw-device input within the Scylla Input module. It maintains a priority-sorted list of registered bridges and delegates keyboard, mouse, and gamepad queries to them according to the active QueryMode.

    Four query modes are available (see InputBridgeQueryMode):

    • SingleBridge Only the highest-priority bridge is consulted. This is the default and matches backward-compatible single-bridge behavior.
    • PriorityChain Bridges are queried in descending priority order. For boolean queries, the first bridge returning true wins. For analog queries, the first bridge with a non-zero value wins.
    • PerInputType A specific bridge is designated for each InputDeviceType via SetBridgeForInputType(InputDeviceType, string). Unassigned types fall back to the highest-priority bridge.
    • CombineAll All available bridges are queried. Boolean results use OR semantics; analog results use the largest absolute value.

    By default a single UnityInputSystemBridge is registered at priority 100. Additional bridges can be registered at runtime for scenarios such as mixing input backends per device type.

    Properties

    ActiveBridge

    Gets the highest-priority bridge that is currently registered.

    Declaration
    IScyllaInputBridge ActiveBridge { get; }
    Property Value
    Type Description
    IScyllaInputBridge

    The first entry in the priority-sorted Bridges list, or null if no bridges are registered. This is the bridge consulted by all input queries when QueryMode is SingleBridge.

    Bridges

    Gets the full list of registered bridges in descending priority order.

    Declaration
    IReadOnlyList<IScyllaInputBridge> Bridges { get; }
    Property Value
    Type Description
    IReadOnlyList<IScyllaInputBridge>

    A read-only view of all bridges, sorted so that the highest-priority bridge is at index 0. The list is re-sorted whenever a bridge is registered or its priority changes via SetBridgePriority(string, int).

    ConflictResolution

    Gets or sets the strategy used to resolve conflicting analog values when multiple bridges each return a non-zero result.

    Declaration
    InputConflictResolution ConflictResolution { get; set; }
    Property Value
    Type Description
    InputConflictResolution

    One of the InputConflictResolution values. Defaults to HighestPriority. This setting is most relevant when QueryMode is CombineAll or PriorityChain.

    QueryMode

    Gets or sets the strategy used to select which bridge(s) answer input queries.

    Declaration
    InputBridgeQueryMode QueryMode { get; set; }
    Property Value
    Type Description
    InputBridgeQueryMode

    One of the InputBridgeQueryMode values. Defaults to SingleBridge, which provides the same behavior as a single-bridge setup. Changes take effect immediately on the next input query.

    Methods

    ClearBridgeForInputType(InputDeviceType)

    Removes the per-input-type bridge assignment for the given device category, reverting to the default ActiveBridge for that type.

    Declaration
    void ClearBridgeForInputType(InputDeviceType inputType)
    Parameters
    Type Name Description
    InputDeviceType inputType

    The InputDeviceType whose routing assignment should be cleared. If no assignment exists, the call is a safe no-op.

    GetAllDevices()

    Returns the list of all input devices reported by the active bridge.

    Declaration
    IReadOnlyList<InputDevice> GetAllDevices()
    Returns
    Type Description
    IReadOnlyList<InputDevice>

    A read-only list of currently connected and enabled devices as seen by the ActiveBridge; an empty list if no bridges are registered or the active bridge reports no devices.

    Remarks

    This method currently delegates to the ActiveBridge only. In future multi-bridge scenarios, device lists from all bridges may be merged.

    GetBridge(string)

    Retrieves a registered bridge by its ID.

    Declaration
    IScyllaInputBridge GetBridge(string bridgeID)
    Parameters
    Type Name Description
    string bridgeID

    The BridgeID to look up.

    Returns
    Type Description
    IScyllaInputBridge

    The registered IScyllaInputBridge with the given ID, or null if no bridge with that ID is registered.

    GetBridgeForInputType(InputDeviceType)

    Returns the bridge ID that is currently assigned to handle a specific input device type.

    Declaration
    string GetBridgeForInputType(InputDeviceType inputType)
    Parameters
    Type Name Description
    InputDeviceType inputType

    The InputDeviceType to query.

    Returns
    Type Description
    string

    The BridgeID of the assigned bridge, or null if no bridge has been assigned for inputType.

    GetBridgePriority(string)

    Returns the effective priority of a registered bridge, accounting for any runtime override set via SetBridgePriority(string, int).

    Declaration
    int GetBridgePriority(string bridgeID)
    Parameters
    Type Name Description
    string bridgeID

    The BridgeID to query.

    Returns
    Type Description
    int

    The override priority if one has been set, otherwise the bridge's own Priority value, or -1 if no bridge with the given ID is registered.

    GetCurrentGamepad()

    Returns a reference to the primary active gamepad as reported by the bridge designated for gamepad queries.

    Declaration
    Gamepad GetCurrentGamepad()
    Returns
    Type Description
    Gamepad

    The current UnityEngine.InputSystem.Gamepad, or null if none is connected or if no bridge is registered. This always delegates to the bridge selected by QueryMode for Gamepad.

    GetDeviceType(InputDevice)

    Classifies an input device into one of the known InputDeviceType categories using the active bridge's classification logic.

    Declaration
    InputDeviceType GetDeviceType(InputDevice device)
    Parameters
    Type Name Description
    InputDevice device

    The device to classify. May be null, in which case Unknown is returned.

    Returns
    Type Description
    InputDeviceType

    The InputDeviceType that describes device, or Unknown if the device is unrecognized, null, or no active bridge is available.

    GetGamepadLeftStick()

    Returns the current value of the left analog stick on the active gamepad, resolved through the active bridge selection strategy.

    Declaration
    Vector2 GetGamepadLeftStick()
    Returns
    Type Description
    Vector2

    A UnityEngine.Vector2 with components in [-1, 1]; UnityEngine.Vector2.zero if no gamepad is connected or no bridges are registered.

    GetGamepadLeftTrigger()

    Returns the current analog value of the left trigger on the active gamepad, resolved through the active bridge selection strategy.

    Declaration
    float GetGamepadLeftTrigger()
    Returns
    Type Description
    float

    A value in [0, 1] where 0 is fully released and 1 is fully pressed; 0f if no gamepad is connected or no bridges are registered.

    GetGamepadRightStick()

    Returns the current value of the right analog stick on the active gamepad, resolved through the active bridge selection strategy.

    Declaration
    Vector2 GetGamepadRightStick()
    Returns
    Type Description
    Vector2

    A UnityEngine.Vector2 with components in [-1, 1]; UnityEngine.Vector2.zero if no gamepad is connected or no bridges are registered.

    GetGamepadRightTrigger()

    Returns the current analog value of the right trigger on the active gamepad, resolved through the active bridge selection strategy.

    Declaration
    float GetGamepadRightTrigger()
    Returns
    Type Description
    float

    A value in [0, 1] where 0 is fully released and 1 is fully pressed; 0f if no gamepad is connected or no bridges are registered.

    GetLastUsedDevice()

    Returns the most recently used input device as reported by the active bridge.

    Declaration
    InputDevice GetLastUsedDevice()
    Returns
    Type Description
    InputDevice

    The UnityEngine.InputSystem.InputDevice that last produced input, or null if no device activity has been recorded or no bridge is registered.

    GetMouseDelta()

    Returns the per-frame mouse movement delta, resolved through the active bridge selection strategy.

    Declaration
    Vector2 GetMouseDelta()
    Returns
    Type Description
    Vector2

    Mouse displacement in pixels; UnityEngine.Vector2.zero if the mouse did not move or no mouse is available.

    GetMousePosition()

    Returns the current mouse cursor position in screen-space pixel coordinates, resolved through the active bridge selection strategy.

    Declaration
    Vector2 GetMousePosition()
    Returns
    Type Description
    Vector2

    Mouse position as a UnityEngine.Vector2 with (0, 0) at the bottom-left; UnityEngine.Vector2.zero if no mouse is connected or no bridges are registered.

    GetMouseScrollDelta()

    Returns the scroll wheel delta for the current frame, resolved through the active bridge selection strategy.

    Declaration
    Vector2 GetMouseScrollDelta()
    Returns
    Type Description
    Vector2

    Scroll delta where y is vertical and x is horizontal scroll; UnityEngine.Vector2.zero if no scroll occurred or no mouse is available.

    HasBridge(string)

    Returns whether a bridge with the given ID is currently registered.

    Declaration
    bool HasBridge(string bridgeID)
    Parameters
    Type Name Description
    string bridgeID

    The BridgeID to test.

    Returns
    Type Description
    bool

    true if a bridge with that ID is registered; false otherwise.

    HasBridgeForInputType(InputDeviceType)

    Returns whether a per-input-type bridge assignment exists for the given device category.

    Declaration
    bool HasBridgeForInputType(InputDeviceType inputType)
    Parameters
    Type Name Description
    InputDeviceType inputType

    The InputDeviceType to test.

    Returns
    Type Description
    bool

    true if a bridge has been assigned for inputType via SetBridgeForInputType(InputDeviceType, string); false otherwise.

    Initialize()

    Initializes the manager and calls Initialize() on every currently registered bridge.

    Declaration
    void Initialize()
    Remarks

    Bridges registered after this call are initialized immediately upon registration. Calling Initialize() more than once without an intervening Shutdown() is a no-op that emits a warning.

    IsAnyKeyPressed()

    Returns whether any keyboard key is currently held down, resolved through the active bridge selection strategy.

    Declaration
    bool IsAnyKeyPressed()
    Returns
    Type Description
    bool

    true if at least one key is pressed; false otherwise or if no keyboard is available.

    IsGamepadButtonPressed(GamepadButton)

    Returns whether the specified gamepad button is currently held down, resolved through the active bridge selection strategy.

    Declaration
    bool IsGamepadButtonPressed(GamepadButton button)
    Parameters
    Type Name Description
    GamepadButton button

    The gamepad button to test.

    Returns
    Type Description
    bool

    true if the button is pressed; false if not pressed, if no gamepad is connected, or if no bridges are registered.

    IsGamepadConnected()

    Returns whether at least one gamepad is currently connected, resolved through the active bridge selection strategy.

    Declaration
    bool IsGamepadConnected()
    Returns
    Type Description
    bool

    true if a gamepad is available; false otherwise or if no bridges are registered.

    IsKeyPressed(Key)

    Returns whether the specified keyboard key is currently held down, resolved through the active bridge selection strategy.

    Declaration
    bool IsKeyPressed(Key key)
    Parameters
    Type Name Description
    Key key

    The key to test.

    Returns
    Type Description
    bool

    true if the key is actively pressed; false if not pressed or if no keyboard is available. Returns false when no bridges are registered.

    IsMouseButtonPressed(int)

    Returns whether the specified mouse button is currently held down, resolved through the active bridge selection strategy.

    Declaration
    bool IsMouseButtonPressed(int button)
    Parameters
    Type Name Description
    int button

    Zero-based index: 0 = left, 1 = right, 2 = middle, 3 = forward, 4 = back.

    Returns
    Type Description
    bool

    true if the button is pressed; false for out-of-range indices, if no mouse is connected, or if no bridges are registered.

    IsMouseConnected()

    Returns whether a mouse device is currently connected, resolved through the active bridge selection strategy.

    Declaration
    bool IsMouseConnected()
    Returns
    Type Description
    bool

    true if a mouse is available; false otherwise or if no bridges are registered.

    RegisterBridge(IScyllaInputBridge)

    Registers a bridge with the manager and immediately incorporates it into input query routing.

    Declaration
    void RegisterBridge(IScyllaInputBridge bridge)
    Parameters
    Type Name Description
    IScyllaInputBridge bridge

    The bridge to register. Must not be null. If a bridge with the same BridgeID is already registered, registration is silently skipped with a warning.

    Remarks

    If the manager has already been initialized when this method is called, the new bridge is initialized immediately. The internal priority list is re-sorted after registration so that the bridge is consulted in the correct order.

    SetBridgeForInputType(InputDeviceType, string)

    Designates a specific bridge to handle all queries for a given input device type when QueryMode is PerInputType.

    Declaration
    void SetBridgeForInputType(InputDeviceType inputType, string bridgeID)
    Parameters
    Type Name Description
    InputDeviceType inputType

    The InputDeviceType category (e.g., Gamepad) for which the routing assignment should apply.

    string bridgeID

    The BridgeID of the bridge that should service queries for inputType. Pass null or an empty string to clear the assignment, which is equivalent to calling ClearBridgeForInputType(InputDeviceType). If the ID does not match a registered bridge, the call is a no-op with a warning.

    SetBridgePriority(string, int)

    Overrides the priority of a registered bridge and re-sorts the bridge list.

    Declaration
    void SetBridgePriority(string bridgeID, int priority)
    Parameters
    Type Name Description
    string bridgeID

    The BridgeID of the bridge to update. If the ID is not found, the call is a no-op with a warning.

    int priority

    The new priority value. Higher values cause the bridge to be consulted before bridges with lower values. There is no enforced range; any integer is valid.

    Remarks

    This override is stored separately from the bridge's own Priority property. The override takes precedence over the bridge's native priority for the lifetime of this manager.

    Shutdown()

    Shuts down the manager, calling Shutdown() on every registered bridge and clearing all internal state.

    Declaration
    void Shutdown()
    Remarks

    After shutdown, all bridge registrations, priority overrides, and per-input-type routing assignments are discarded. The manager can be re-initialized by calling Initialize() again.

    UnregisterBridge(string)

    Unregisters the bridge with the given ID, shutting it down and removing it from all routing tables.

    Declaration
    void UnregisterBridge(string bridgeID)
    Parameters
    Type Name Description
    string bridgeID

    The BridgeID of the bridge to remove. If no bridge with this ID is registered, the call is a no-op with a warning.

    Remarks

    The bridge's Shutdown() is called before removal. Any per-input-type routing assignments that reference this bridge ID remain in the routing table but will resolve to the ActiveBridge at query time until reassigned or cleared.

    Update()

    Advances per-frame state in all available bridges. Must be called once per frame.

    Declaration
    void Update()
    Remarks

    Only bridges where IsAvailable is true receive the Update() call. Bridges that report unavailable are silently skipped.

    WasGamepadButtonPressedThisFrame(GamepadButton)

    Returns whether the specified gamepad button transitioned to pressed this frame, resolved through the active bridge selection strategy.

    Declaration
    bool WasGamepadButtonPressedThisFrame(GamepadButton button)
    Parameters
    Type Name Description
    GamepadButton button

    The gamepad button to test.

    Returns
    Type Description
    bool

    true only on the frame the button was first pressed; false in all other frames or if no gamepad is connected.

    WasGamepadButtonReleasedThisFrame(GamepadButton)

    Returns whether the specified gamepad button transitioned to released this frame, resolved through the active bridge selection strategy.

    Declaration
    bool WasGamepadButtonReleasedThisFrame(GamepadButton button)
    Parameters
    Type Name Description
    GamepadButton button

    The gamepad button to test.

    Returns
    Type Description
    bool

    true only on the frame the button was released; false in all other frames or if no gamepad is connected.

    WasKeyPressedThisFrame(Key)

    Returns whether the specified keyboard key transitioned to pressed this frame, resolved through the active bridge selection strategy.

    Declaration
    bool WasKeyPressedThisFrame(Key key)
    Parameters
    Type Name Description
    Key key

    The key to test.

    Returns
    Type Description
    bool

    true only on the frame the key was first pressed; false in all other frames or if no keyboard is available.

    WasKeyReleasedThisFrame(Key)

    Returns whether the specified keyboard key transitioned to released this frame, resolved through the active bridge selection strategy.

    Declaration
    bool WasKeyReleasedThisFrame(Key key)
    Parameters
    Type Name Description
    Key key

    The key to test.

    Returns
    Type Description
    bool

    true only on the frame the key was released; false in all other frames or if no keyboard is available.

    WasMouseButtonPressedThisFrame(int)

    Returns whether the specified mouse button transitioned to pressed this frame, resolved through the active bridge selection strategy.

    Declaration
    bool WasMouseButtonPressedThisFrame(int button)
    Parameters
    Type Name Description
    int button

    Zero-based index: 0 = left, 1 = right, 2 = middle, 3 = forward, 4 = back.

    Returns
    Type Description
    bool

    true only on the frame the button was first pressed; false in all other frames or if no mouse is connected.

    WasMouseButtonReleasedThisFrame(int)

    Returns whether the specified mouse button transitioned to released this frame, resolved through the active bridge selection strategy.

    Declaration
    bool WasMouseButtonReleasedThisFrame(int button)
    Parameters
    Type Name Description
    int button

    Zero-based index: 0 = left, 1 = right, 2 = middle, 3 = forward, 4 = back.

    Returns
    Type Description
    bool

    true only on the frame the button was released; false in all other frames or if no mouse is connected.

    Events

    OnDeviceConnected

    Raised when any input device is connected or reconnected through any registered bridge.

    Declaration
    event Action<InputDevice> OnDeviceConnected
    Event Type
    Type Description
    Action<InputDevice>
    Remarks

    Aggregates OnDeviceConnected events from all registered bridges. Subscribers do not need to monitor individual bridges.

    OnDeviceDisconnected

    Raised when any input device is disconnected through any registered bridge.

    Declaration
    event Action<InputDevice> OnDeviceDisconnected
    Event Type
    Type Description
    Action<InputDevice>
    Remarks

    Aggregates OnDeviceDisconnected events from all registered bridges. Subscribers do not need to monitor individual bridges.

    In this article
    Back to top Scylla Framework - Input Module API Documentation