Game.Input.BindingKeyboard
Assembly: Assembly-CSharp (common Unity game assembly; replace with actual assembly if different)
Namespace: Game.Input
Type: enum
Base: System.Enum (underlying type: System.Int32)
Summary: Represents keyboard key identifiers used by the game's input/binding system. Each named value corresponds to a physical or logical keyboard key and has an explicit integer value. Useful for storing, comparing or serializing key bindings in mods for Cities: Skylines 2.
Fields
-
None = 0
Represents no key (unassigned). -
Space = 1
Spacebar key. -
Enter = 2
Return / Enter key. -
Tab = 3
Tab key. -
Backquote = 4
Backquote / grave accent key (`). -
Quote = 5
Single-quote / apostrophe key ('). -
Semicolon = 6
Semicolon key (;). -
Comma = 7
Comma key (,). -
Period = 8
Period / dot key (.). -
Slash = 9
Forward slash key (/). -
Backslash = 10
Backslash key (). -
LeftBracket = 11
Left bracket key ([). -
RightBracket = 12
Right bracket key (]). -
Minus = 13
Minus / hyphen key (-). -
Equals = 14
Equals key (=). -
A = 15
Letter key A. -
B = 16
Letter key B. -
C = 17
Letter key C. -
D = 18
Letter key D. -
E = 19
Letter key E. -
F = 20
Letter key F. -
G = 21
Letter key G. -
H = 22
Letter key H. -
I = 23
Letter key I. -
J = 24
Letter key J. -
K = 25
Letter key K. -
L = 26
Letter key L. -
M = 27
Letter key M. -
N = 28
Letter key N. -
O = 29
Letter key O. -
P = 30
Letter key P. -
Q = 31
Letter key Q. -
R = 32
Letter key R. -
S = 33
Letter key S. -
T = 34
Letter key T. -
U = 35
Letter key U. -
V = 36
Letter key V. -
W = 37
Letter key W. -
X = 38
Letter key X. -
Y = 39
Letter key Y. -
Z = 40
Letter key Z. -
Digit1 = 41
Top-row numeric key 1. -
Digit2 = 42
Top-row numeric key 2. -
Digit3 = 43
Top-row numeric key 3. -
Digit4 = 44
Top-row numeric key 4. -
Digit5 = 45
Top-row numeric key 5. -
Digit6 = 46
Top-row numeric key 6. -
Digit7 = 47
Top-row numeric key 7. -
Digit8 = 48
Top-row numeric key 8. -
Digit9 = 49
Top-row numeric key 9. -
Digit0 = 50
Top-row numeric key 0. -
Escape = 60
Escape key (Esc). -
LeftArrow = 61
Left arrow key. -
RightArrow = 62
Right arrow key. -
UpArrow = 63
Up arrow key. -
DownArrow = 64
Down arrow key. -
Backspace = 65
Backspace key. -
PageDown = 66
Page Down key. -
PageUp = 67
Page Up key. -
Home = 68
Home key. -
End = 69
End key. -
Delete = 71
Delete key. -
NumpadEnter = 77
Enter key on the numeric keypad. -
NumpadDivide = 78
Numpad divide (/). -
NumpadMultiply = 79
Numpad multiply (*). -
NumpadPlus = 80
Numpad plus (+). -
NumpadMinus = 81
Numpad minus (-). -
NumpadPeriod = 82
Numpad decimal point. -
NumpadEquals = 83
Numpad equals (if present). -
Numpad0 = 84
Numpad 0. -
Numpad1 = 85
Numpad 1. -
Numpad2 = 86
Numpad 2. -
Numpad3 = 87
Numpad 3. -
Numpad4 = 88
Numpad 4. -
Numpad5 = 89
Numpad 5. -
Numpad6 = 90
Numpad 6. -
Numpad7 = 91
Numpad 7. -
Numpad8 = 92
Numpad 8. -
Numpad9 = 93
Numpad 9. -
F1 = 94
Function key F1. -
F2 = 95
Function key F2. -
F3 = 96
Function key F3. -
F4 = 97
Function key F4. -
F5 = 98
Function key F5. -
F6 = 99
Function key F6. -
F7 = 100
Function key F7. -
F8 = 101
Function key F8. -
F9 = 102
Function key F9. -
F10 = 103
Function key F10. -
F11 = 104
Function key F11. -
F12 = 105
Function key F12. -
OEM1 = 106
OEM-specific key 1 (layout/platform dependent). -
OEM2 = 107
OEM-specific key 2 (layout/platform dependent). -
OEM3 = 108
OEM-specific key 3 (layout/platform dependent). -
OEM4 = 109
OEM-specific key 4 (layout/platform dependent). -
OEM5 = 110
OEM-specific key 5 (layout/platform dependent).
Properties
- None specific to this enum.
You can cast values to/from the underlying integer type (int) and use standard System.Enum helpers (Enum.Parse, Enum.GetValues, etc.).
Constructors
- Enums do not expose public constructors.
The default value for an enum variable is the value with underlying integer 0 (here: BindingKeyboard.None).
Methods
- No instance methods are defined on the enum type itself.
Inherited/available via System.Enum: ToString(), CompareTo(), GetHashCode(), HasFlag(), Enum.Parse, Enum.TryParse, Enum.GetValues, etc.
Usage Example
// Simple usage examples for binding checks and serialization
// Assign or read a binding
BindingKeyboard currentBinding = BindingKeyboard.Space;
// Compare
if (currentBinding == BindingKeyboard.Space)
{
// Handle action bound to Space
}
// Serialize to an int (e.g., save to settings file)
int savedValue = (int)currentBinding;
// Deserialize (be sure to validate)
BindingKeyboard restored = (BindingKeyboard)savedValue;
// Safe parse from string
if (Enum.TryParse<BindingKeyboard>("Enter", out var parsed))
{
// parsed == BindingKeyboard.Enter
}
// Iterate all defined keys
foreach (BindingKeyboard key in Enum.GetValues(typeof(BindingKeyboard)))
{
// key is one of the enum values
}
Notes: - OEM keys are layout/platform dependent; mapping to physical keys may vary by keyboard layout and platform. - If you need to map these values to UnityEngine.KeyCode or another input API, implement a mapping table to translate between BindingKeyboard and the target key representation.