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

    Class InputDeviceUtil

    Provides centralized helpers for classifying Unity Input System devices and binding path strings into InputDeviceType categories, avoiding duplicated type-switch logic across the Input module's internal managers.

    Inheritance
    object
    InputDeviceUtil
    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 static class InputDeviceUtil
    Remarks

    All methods are stateless and allocation-free (except GetDeviceTypeFromPath(string), which calls string.ToLowerInvariant() to normalize the path before inspection). They are safe to call from any thread.

    The classification methods use Unity's Input System type hierarchy. A Gamepad check catches all controllers that derive from UnityEngine.InputSystem.Gamepad (XInput, DualShock, etc.). Joysticks that do not extend Gamepad are classified separately as Joystick.

    Methods

    GetDeviceType(InputDevice)

    Determines the InputDeviceType category for the given Unity Input System InputDevice instance by inspecting its runtime type.

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

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

    Returns
    Type Description
    InputDeviceType

    The InputDeviceType that best describes the device. Returns Unknown when device is null or when the device's runtime type does not match any of the recognized categories (Keyboard, Mouse, Gamepad, Touchscreen, Joystick, or Pen).

    GetDeviceTypeFromPath(string)

    Determines the InputDeviceType category for the device identified in a Unity Input System binding path string such as <Keyboard>/space or <Gamepad>/buttonSouth.

    Declaration
    public static InputDeviceType GetDeviceTypeFromPath(string bindingPath)
    Parameters
    Type Name Description
    string bindingPath

    A Unity Input System binding path string. The method inspects the device-layout component enclosed in angle brackets at the start of the path (e.g., <Keyboard>, <Mouse>, <Gamepad>, <XInputController>, <DualShockGamepad>, <Touchscreen>, <Joystick>, <Pen>). May be null or empty, in which case Unknown is returned.

    Returns
    Type Description
    InputDeviceType

    The InputDeviceType that corresponds to the device layout named in the path. Returns Unknown when bindingPath is null, empty, or does not contain a recognized device layout token.

    Remarks

    The comparison is case-insensitive: the path is converted to lowercase with string.ToLowerInvariant() before the device-token substring checks are applied. Gamepad paths produced by XInput (<XInputController>) and PlayStation controllers (<DualShockGamepad>) are both mapped to Gamepad.

    IsGamepadOrJoystick(InputDevice)

    Returns true when the given device is a gamepad or a joystick - the two controller categories that represent hands-on analog input hardware.

    Declaration
    public static bool IsGamepadOrJoystick(InputDevice device)
    Parameters
    Type Name Description
    InputDevice device

    The device to test. May be null; a null value returns false.

    Returns
    Type Description
    bool

    true if device is an instance of UnityEngine.InputSystem.Gamepad or UnityEngine.InputSystem.Joystick; false otherwise.

    IsKeyboardOrMouse(InputDevice)

    Returns true when the given device is a keyboard or a mouse - the two devices that together form the standard desktop input pair.

    Declaration
    public static bool IsKeyboardOrMouse(InputDevice device)
    Parameters
    Type Name Description
    InputDevice device

    The device to test. May be null; a null value returns false.

    Returns
    Type Description
    bool

    true if device is an instance of UnityEngine.InputSystem.Keyboard or UnityEngine.InputSystem.Mouse; false otherwise.

    IsTouchDevice(InputDevice)

    Returns true when the given device is a pointer-contact input device, meaning it reports input via direct surface contact rather than buttons or analog axes. This covers touchscreens and pen/stylus devices.

    Declaration
    public static bool IsTouchDevice(InputDevice device)
    Parameters
    Type Name Description
    InputDevice device

    The device to test. May be null; a null value returns false.

    Returns
    Type Description
    bool

    true if device is an instance of UnityEngine.InputSystem.Touchscreen or UnityEngine.InputSystem.Pen; false otherwise.

    See Also

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