Enum InputDeviceChange | Input System | 1.0.2
docs.unity3d.com
    Show / Hide Table of Contents

    Enum InputDeviceChange

    Indicates what type of change related to an InputDevice occurred.

    Namespace: UnityEngine.InputSystem
    Syntax
    public enum InputDeviceChange
    Remarks

    Use onDeviceChange to receive notifications about changes to the input device setup in the system.

    InputSystem.onDeviceChange +=
        (device, change) =>
        {
            switch (change)
            {
                case InputDeviceChange.Added:
                    Debug.Log($"Device {device} was added");
                    break;
                case InputDeviceChange.Removed:
                    Debug.Log($"Device {device} was removed");
                    break;
            }
        };

    Fields

    Name Description Value
    Added

    A new device was added to the system. This is triggered after the device has already been added, i.e. it already appears on devices.

    0
    Removed

    An existing device was removed from the system. This is triggered after the device has already been removed, i.e. it already has been cleared from devices.

    1
    Disconnected

    A device reported by the UnityEngine.InputSystem.LowLevel.IInputRuntime was Removed but was retained by the system as disconnectedDevices.

    2
    Reconnected

    A device that was previously retained as Disconnected has been re-discovered and has been Added to the system again.

    3
    Enabled

    An existing device was re-enabled after having been Disabled.

    4
    Disabled

    An existing device was disabled.

    5
    UsageChanged

    The usages on a device have changed.

    6
    ConfigurationChanged

    The configuration of a device has changed.

    7
    Destroyed 8
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023