Scylla Framework
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Scylla.Input
      • AutoResolveChange
      • AutoResolveResult
      • BindingConflict
      • BindingStorageSettings
      • BindingStorageType
      • BridgeSettings
      • BufferedInput
      • ConfigActionEntry
      • ConfigActionGroup
      • ConfigBindingEntry
      • ConfigConflict
      • ConfigGroupExclusion
      • ConfigLayout
      • ConfigLayout.Builder
      • ConfigLayoutColumnDefinition
      • ConfigLayoutConflictScope
      • ConfigLayoutDefinition
      • ConfigLayoutExclusionDefinition
      • ConfigLayoutGroupDefinition
      • ConfigLayoutGroupMode
      • ConfigLayoutMemberReference
      • ConfigLayoutValidationMessage
      • ConfigLayoutValidationSeverity
      • ConfigSchemeGroup
      • ContextConflictScope
      • ContextValidationMessage
      • ContextValidationSeverity
      • ControlScheme
      • ControlSchemeChangedEvent
      • ControlSchemeManager
      • ControlSchemeType
      • GamepadButton
      • GamepadType
      • IBindingStorage
      • IControlSchemeManager
      • IInputActionManager
      • IInputBindingManager
      • IInputBridgeManager
      • IInputBufferManager
      • IInputConflictScope
      • IInputContextManager
      • IInputControlAliasResolver
      • IInputHintsManager
      • IInputListener
      • IInputRebindabilityProvider
      • IScyllaInputBridge
      • IdentityControlAliasResolver
      • InputActionCanceledEvent
      • InputActionManager
      • InputActionMapNode
      • InputActionMetadata
      • InputActionNode
      • InputActionPerformedEvent
      • InputActionStartedEvent
      • InputActionsDocument
      • InputActionsDocumentIO
      • InputActionsJSONKeys
      • InputAnnotation
      • InputAssetInfo
      • InputBindingGroups
      • InputBindingManager
      • InputBindingMetadata
      • InputBindingNode
      • InputBindingsLoadedEvent
      • InputBindingsSavedEvent
      • InputBridgeManager
      • InputBridgeQueryMode
      • InputBufferConsumedEvent
      • InputBufferManager
      • InputBufferedEvent
      • InputCodegenSettings
      • InputCompositeUtil
      • InputConflictEngine
      • InputConflictPair
      • InputConflictPolicy
      • InputConflictReason
      • InputConflictRecord
      • InputConflictRecordBuilder
      • InputConflictResolution
      • InputConflictSet
      • InputContext
      • InputContextChangedEvent
      • InputContextDefinition
      • InputContextExclusivity
      • InputContextManager
      • InputContextPoppedEvent
      • InputContextPushedEvent
      • InputControlAliasEntry
      • InputControlAliasResolver
      • InputControlAliasScope
      • InputControlPathUtil
      • InputControlSchemeNode
      • InputDeviceChangedEvent
      • InputDeviceConnectedEvent
      • InputDeviceDisconnectedEvent
      • InputDeviceType
      • InputDeviceUtil
      • InputDisabledEvent
      • InputEnabledEvent
      • InputEventType
      • InputHint
      • InputHintChangedEvent
      • InputHintsManager
      • InputIconSet
      • InputIconSet.IconMapping
      • InputIconSetChangedEvent
      • InputInteractionKind
      • InputInteractionResolver
      • InputInteractionSignature
      • InputJSONMember
      • InputJSONNode
      • InputJSONNodeReader
      • InputJSONNodeType
      • InputJSONNodeWriter
      • InputLoggingSettings
      • InputMapMetadata
      • InputMetadataRebindabilityProvider
      • InputMetadataReconciler
      • InputMetadataRecordKind
      • InputModifierMetadataUtil
      • InputOrphanRecord
      • InputRebindCancelledEvent
      • InputRebindCompletedEvent
      • InputRebindManager
      • InputRebindOperation
      • InputRebindStartedEvent
      • InputRebindUtils
      • InputRebindability
      • InputReconcileAction
      • InputReconcileOptions
      • InputReconcileReport
      • InputReconcileReport.Entry
      • InputSchemeDeviceNode
      • InputSchemeMetadata
      • JSONFileBindingStorage
      • ManagedRebindCancelledEvent
      • ManagedRebindCompletedEvent
      • ManagedRebindDataRefreshedEvent
      • ManagedRebindStartedEvent
      • PlayerPrefsBindingStorage
      • RebindMode
      • RebindSettings
      • ScyllaInput
      • ScyllaInput.Meta
      • ScyllaInputAction
      • ScyllaInputActionMap
      • ScyllaInputActionsMetadata
      • ScyllaInputActionsMetadataMigrator
      • ScyllaInputBinding
      • ScyllaInputConfiguration
      • ScyllaInputContextConfiguration
      • ScyllaKey
      • ScyllaKeyConverter
      • ScyllaModifier
      • UnityInputSystemBridge
    • Scylla.Input.Editor
      • DeviceStatusWidget
      • IconMappingDrawer
      • InputIconSetEditor
      • ScyllaInputActionsMetadataEditor
      • ScyllaInputConfigurationEditor
      • ScyllaInputContextConfigurationEditor
      • ScyllaInputDependencyProvider
      • ScyllaInputEditor
      • ScyllaInputGameProfile
      • ScyllaInputGameProfiles
      • ScyllaInputMenuItems
      • ScyllaInputWizard

    Class InputBridgeManager

    Concrete implementation of IInputBridgeManager that coordinates input queries across one or more registered IScyllaInputBridge instances.

    Inheritance
    object
    InputBridgeManager
    Implements
    IInputBridgeManager
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Scylla.Input
    Assembly: ScyllaInput.dll
    Syntax
    public class InputBridgeManager : IInputBridgeManager
    Remarks

    Bridges are stored in a priority-sorted list and queried according to the active QueryMode. All input query methods delegate to one of three internal helpers - QueryBool, QueryFloat, and QueryVector2 - each of which implements the full InputBridgeQueryMode switch.

    By default the manager operates in SingleBridge mode with HighestPriority. This matches the behavior of a classic single-bridge setup and requires no additional configuration.

    Device connection and disconnection events from individual bridges are forwarded through the manager's own OnDeviceConnected and OnDeviceDisconnected events, so consumers only need to subscribe once.

    Properties

    ActiveBridge

    Gets the highest-priority bridge that is currently registered.

    Declaration
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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.

    Implements

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