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.
The DrawDeviceSummary(IReadOnlyList<InputDevice>, IInputBridgeManager) method uses a shared StringBuilder to build the summary string; it is not thread-safe.
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 |
Draw(InputDevice, InputDeviceType)
Draws a full-width horizontal row containing a color-coded device-type badge, the device's display name in bold, and a connection-status label ("Connected" in green or "Disconnected" in grey). The row uses the fixed height defined by Scylla.Input.Editor.DeviceStatusWidget.ROW_HEIGHT.
Declaration
public static void Draw(InputDevice device, InputDeviceType deviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| InputDevice | device | The UnityEngine.InputSystem.InputDevice to render. When null, a "No device" placeholder is drawn instead. |
| InputDeviceType | deviceType | The pre-resolved InputDeviceType for |
DrawCompact(InputDevice, InputDeviceType)
Draws a compact single-line indicator consisting of just the color-coded device-type badge and the device's display name, without a connection-status label. Useful for embedding in two-column inspector rows alongside a field label.
Declaration
public static void DrawCompact(InputDevice device, InputDeviceType deviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| InputDevice | device | The UnityEngine.InputSystem.InputDevice to render. When null, renders a muted "None" label. |
| InputDeviceType | deviceType | The pre-resolved InputDeviceType for |
DrawDeviceList(IReadOnlyList<InputDevice>, IInputBridgeManager)
Draws one Draw(InputDevice, InputDeviceType) row per device in devices, skipping
any null entries. Renders a "No devices connected." muted label when
the list is null or empty.
Declaration
public static void DrawDeviceList(IReadOnlyList<InputDevice> devices, IInputBridgeManager bridgeManager)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<InputDevice> | devices | The read-only list of UnityEngine.InputSystem.InputDevice objects to render, as returned by
|
| IInputBridgeManager | bridgeManager | The IInputBridgeManager used to resolve each device's InputDeviceType. When null, all devices default to Unknown. |
DrawDeviceSummary(IReadOnlyList<InputDevice>, IInputBridgeManager)
Draws a compact single-line text summary counting devices by type, formatted as a
comma-separated list (e.g., "1 KB, 1 M, 2 GP"). Renders a muted "No devices"
label when the list is null or empty.
Declaration
public static void DrawDeviceSummary(IReadOnlyList<InputDevice> devices, IInputBridgeManager bridgeManager)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<InputDevice> | devices | The read-only list of UnityEngine.InputSystem.InputDevice objects to summarize. |
| IInputBridgeManager | bridgeManager | The IInputBridgeManager used to resolve each device's InputDeviceType. When null, all devices are counted as "Other". |
Remarks
Uses a shared StringBuilder instance; this method is not thread-safe. Device types that do not fall into Keyboard, Mouse, or Gamepad categories are counted together in the "Other" bucket.
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 |