Enum InputDeviceChange
Indicates what type of change related to an input device occurred.
Namespace: UnityEngine .InputSystem
Assembly: Unity.InputSystem.dll
Syntax
public enum InputDeviceChange
Remarks
Use on
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 |
---|---|
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. See also Add |
ConfigurationChanged | The configuration of a device has changed. This may signal, for example, that the layout used by the keyboard has changed or that, on a console, a gamepad has changed which player ID(s) it is assigned to. See also Device |
Disabled | An existing device was disabled. See also Disable |
Disconnected | A device reported by the IInput See also disconnected |
Enabled | An existing device was re-enabled after having been Disabled. See also Enable |
HardReset | Device is being "hard" reset, i.e. every control is reset to its default value. This happens only
when explicitly forced through Reset This notification is sent before the actual reset happens. |
Reconnected | A device that was previously retained as Disconnected has been re-discovered and has been Added to the system again. See also disconnected |
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. Other than when a device is removed programmatically, this happens when a device
is unplugged from the system. Subsequent to the notification, the system will remove
the Input See also Remove |
SoftReset | Device is being "soft" reset but in a way that excludes dont This notification is sent before the actual reset happens. |
UsageChanged | The usages on a device have changed. This may signal, for example, that what was the right hand XR controller before is now the left hand controller. See also Set |