Class InputDeviceChangedEvent
Published via the Scylla Event eXchange System (SEX) when the most recently used input device changes, for example when a player switches from keyboard to a gamepad mid-session.
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public class InputDeviceChangedEvent : ScyllaEvent
Remarks
This event is driven by activity detection, not physical connection changes. It fires whenever the input system observes that a different device produced input more recently than the previously tracked device. Connecting a device does not fire it until that device produces input. Disconnecting the last-used device does fire it, because the bridge then falls back to another connected device. The module checks once per frame and publishes only on an actual change.
A change is debounced by a cooldown (ScyllaInputConfiguration.DeviceChangeCooldown,
0.25 seconds by default). The event is published only after the newly detected device has
stayed the last-used device for the whole cooldown, so mouse look combined with key
presses does not produce a stream of keyboard and mouse flips. The cooldown is measured
in unscaled real time and is not affected by pause or timescale. When the previously
reported device was disconnected, the change is published immediately without waiting.
A cooldown of 0 publishes every change. Re-enabling input starts from the current
device and does not publish a change for anything that happened while input was off.
Subscribe via ScyllaEvents.Listen<InputDeviceChangedEvent>.
For control-scheme-aware reactions (such as updating button-prompt icons),
prefer subscribing to ControlSchemeChangedEvent instead, which
maps device activity to high-level scheme categories.
Properties
CurrentDevice
Gets or sets the Unity Input System device that is now the most recently used.
This is the device whose activity triggered the event, or the fallback device
chosen after the last-used device was disconnected. May be null when no
device remains.
Declaration
public InputDevice CurrentDevice { get; set; }
Property Value
| Type | Description |
|---|---|
| InputDevice |
CurrentDeviceType
Gets or sets the Scylla-classified device type of CurrentDevice.
Declaration
public InputDeviceType CurrentDeviceType { get; set; }
Property Value
| Type | Description |
|---|---|
| InputDeviceType |
PreviousDevice
Gets or sets the Unity Input System device that was active before the switch,
or null if no device was considered active at the time of the change.
Declaration
public InputDevice PreviousDevice { get; set; }
Property Value
| Type | Description |
|---|---|
| InputDevice |
PreviousDeviceType
Gets or sets the Scylla-classified device type of PreviousDevice.
Will be Unknown when PreviousDevice
is null.
Declaration
public InputDeviceType PreviousDeviceType { get; set; }
Property Value
| Type | Description |
|---|---|
| InputDeviceType |