Class ScyllaKeyConverter
Provides bidirectional conversion between ScyllaKey and Unity's
UnityEngine.InputSystem.Key enum, insulating game code from a direct
compile-time dependency on the Input System package.
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public static class ScyllaKeyConverter
Remarks
Both conversion directions are implemented as exhaustive switch expressions.
Any ScyllaKey or Key value that has no explicit mapping
- including values added by future Unity Input System updates - returns
None or Key.None respectively via the
default arm of the switch, so callers always receive a valid result without
needing to guard against exceptions.
Because the numeric values of ScyllaKey intentionally mirror
Unity's Key enum, the switch-expression compiles to an efficient jump
table with no heap allocations. Direct enum casts between the two types are
technically valid today but callers should always use these methods to remain
correct if the mappings ever diverge.
Note that Key.IMESelected is explicitly excluded from
FromInputSystemKey(Key) because it is marked obsolete by Unity.
Callers that receive Key.IMESelected from the Input System will get
None as the result.
Methods
FromInputSystemKey(Key)
Converts a Unity Input System Key value to the equivalent
ScyllaKey, typically used when translating raw Input System
keyboard events into the framework-owned key type.
Declaration
public static ScyllaKey FromInputSystemKey(Key key)
Parameters
| Type | Name | Description |
|---|---|---|
| Key | key | The Unity Input System |
Returns
| Type | Description |
|---|---|
| ScyllaKey | The ScyllaKey enum value that corresponds to
|
ToInputSystemKey(ScyllaKey)
Converts a ScyllaKey value to the equivalent Unity Input System
Key value, allowing Scylla-aware code to interface with the Unity Input
System API without holding a direct reference to the ScyllaKey type in
the consuming code.
Declaration
public static Key ToInputSystemKey(ScyllaKey key)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaKey | key | The ScyllaKey value to convert. Passing
None returns |
Returns
| Type | Description |
|---|---|
| Key | The Unity Input System |