Class DeviceStatusWidget
Provides static editor utility methods for rendering InputDevice information with
color-coded type badges, used consistently across Scylla Input editor tools.
Inherited Members
Namespace: Scylla.Input.Editor
Assembly: ScyllaInput.Editor.dll
Syntax
public static class DeviceStatusWidget
Remarks
Supported device types and their visual properties:
- Keyboard (
[KB]) - blue (Scylla.Core.Editor.ScyllaEditorColors.Info). - Mouse (
[M]) - blue (Scylla.Core.Editor.ScyllaEditorColors.Info). - Gamepad (
[GP]) - green (Scylla.Core.Editor.ScyllaEditorColors.Success). - Touchscreen (
[TS]) - yellow (Scylla.Core.Editor.ScyllaEditorColors.Warning). - Joystick (
[JS]) - purple. - Pen (
[PN]) - cyan. - Unknown (
[?]) - muted grey.
Icon UnityEngine.GUIContent objects are lazy-initialized and cached in static fields to avoid allocating new instances on every repaint.
UI Toolkit only. An IMGUI half once sat alongside this one, four Draw methods
built on EditorGUILayout, and it was removed: nothing called any of them, and
the project's editor UI is UI Toolkit by mandate, so wiring one up would have
reintroduced IMGUI rather than reused something.
Methods
CreateCompactWidget(InputDevice, InputDeviceType)
Creates a compact UnityEngine.UIElements.VisualElement showing the color-coded badge and
device name without a connection-status column.
Returns a muted "None" label when device is null.
Declaration
public static VisualElement CreateCompactWidget(InputDevice device, InputDeviceType deviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| InputDevice | device | The input device to display. |
| InputDeviceType | deviceType | The pre-resolved device type used for badge color selection. |
Returns
| Type | Description |
|---|---|
| VisualElement |
CreateDeviceListWidget(IReadOnlyList<InputDevice>, IInputBridgeManager)
Creates a UnityEngine.UIElements.VisualElement containing one CreateDeviceRow(InputDevice, InputDeviceType)
per device in devices, or a muted "No devices connected." label
when the list is null or empty.
Declaration
public static VisualElement CreateDeviceListWidget(IReadOnlyList<InputDevice> devices, IInputBridgeManager bridgeManager)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<InputDevice> | devices | The list of devices to display. |
| IInputBridgeManager | bridgeManager | Used to resolve each device's type. May be null. |
Returns
| Type | Description |
|---|---|
| VisualElement |
CreateDeviceRow(InputDevice, InputDeviceType)
Creates a UnityEngine.UIElements.VisualElement row containing a color-coded badge label,
the device display name, and a "Connected" or "Disconnected" status label.
Returns a placeholder row when device is null.
Declaration
public static VisualElement CreateDeviceRow(InputDevice device, InputDeviceType deviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| InputDevice | device | The input device to display. |
| InputDeviceType | deviceType | The pre-resolved device type used for badge color selection. |
Returns
| Type | Description |
|---|---|
| VisualElement |
GetDeviceTypeColor(InputDeviceType)
Returns the editor tint color associated with the specified InputDeviceType, applied to the device-type badge text in all draw methods.
Declaration
public static Color GetDeviceTypeColor(InputDeviceType deviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| InputDeviceType | deviceType | The device type to look up. |
Returns
| Type | Description |
|---|---|
| Color | A UnityEngine.Color value: blue for Keyboard/Mouse, green for Gamepad, yellow for Touchscreen, purple for Joystick, cyan for Pen, and muted grey for Unknown or any unrecognized value. |
GetDeviceTypeIcon(InputDeviceType)
Returns the lazily cached UnityEngine.GUIContent badge for the specified InputDeviceType, containing a short abbreviation as the text and a human-readable name as the tooltip.
Declaration
public static GUIContent GetDeviceTypeIcon(InputDeviceType deviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| InputDeviceType | deviceType | The device type to look up. |
Returns
| Type | Description |
|---|---|
| GUIContent | A UnityEngine.GUIContent instance: |
GetDeviceTypeLabel(InputDeviceType)
Returns a human-readable display name for the specified InputDeviceType, suitable for use in log messages, tooltips, or label fields.
Declaration
public static string GetDeviceTypeLabel(InputDeviceType deviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| InputDeviceType | deviceType | The device type to look up. |
Returns
| Type | Description |
|---|---|
| string | One of the strings |