Enum InputDeviceChange | Input System | 1.0.2
docs.unity.cn
    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 © 2020 Unity Technologies
    Generated by DocFX
    on 22 January 2021