InputCode Enumeration |
[This is preliminary documentation and is subject to change.]
Namespace: RavingBots.MultiInput
public enum InputCode
Member name | Value | Description | |
---|---|---|---|
None | 0 | Value reserved for unknown codes or uninitialized variables. | |
Key0 | 100000 | The 0 key (alphanumeric). | |
Key1 | 100001 | The 1 key (alphanumeric). | |
Key2 | 100002 | The 2 key (alphanumeric). | |
Key3 | 100003 | The 3 key (alphanumeric). | |
Key4 | 100004 | The 4 key (alphanumeric). | |
Key5 | 100005 | The 5 key (alphanumeric). | |
Key6 | 100006 | The 6 key (alphanumeric). | |
Key7 | 100007 | The 7 key (alphanumeric). | |
Key8 | 100008 | The 8 key (alphanumeric). | |
Key9 | 100009 | The 9 key (alphanumeric). | |
KeyA | 100010 | The A key. | |
KeyB | 100011 | The B key. | |
KeyC | 100012 | The C key. | |
KeyD | 100013 | The D key. | |
KeyE | 100014 | The E key. | |
KeyF | 100015 | The F key. | |
KeyG | 100016 | The G key. | |
KeyH | 100017 | The H key. | |
KeyI | 100018 | The I key. | |
KeyJ | 100019 | The J key. | |
KeyK | 100020 | The K key. | |
KeyL | 100021 | The L key. | |
KeyM | 100022 | The M key. | |
KeyN | 100023 | The N key. | |
KeyO | 100024 | The O key. | |
KeyP | 100025 | The P key. | |
KeyQ | 100026 | The Q key. | |
KeyR | 100027 | The R key. | |
KeyS | 100028 | The S key. | |
KeyT | 100029 | The T key. | |
KeyU | 100030 | The U key. | |
KeyV | 100031 | The V key. | |
KeyW | 100032 | The W key. | |
KeyX | 100033 | The X key. | |
KeyY | 100034 | The Y key. | |
KeyZ | 100035 | The Z key. | |
KeySemicolon | 100036 | The OEM 1 key: ; (semicolon) and : (colon) on the US International layout. | |
KeySlash | 100037 | The OEM 2 key: / (slash) and ? (question mark) on the US International layout. | |
KeyAccent | 100038 | The OEM 3 key: ` (grave accent/backtick) and ~ (tilde) on the US International layout. | |
KeyLeftBracket | 100039 | The OEM 4 key: [ (left bracket) and { (left brace) on the US International layout. | |
KeyBackslash | 100040 | The OEM 5 key: \ (backslash) and | (vertical bar/pipe) on the US International layout. | |
KeyRightBracket | 100041 | The OEM 6 key: ] (right bracket) and } (right brace) on the US International layout. | |
KeyQuote | 100042 | The OEM 7 key: ' (apostrophe/single quote) and " (double quote) on the US International layout. | |
KeyOem8 | 100043 | The OEM 8 key: not present on the US International layout. | |
KeyOem102 | 100044 | The OEM 102 key: additional KeyBackslash on the US International layout. | |
KeyBackspace | 100045 | The Backspace key. | |
KeyTab | 100046 | The Tab key. | |
KeyClear | 100047 | The Clear key (Apple keyboards). | |
KeyEnter | 100048 | The primary Enter key. | |
KeyEscape | 100049 | The Escape key. | |
KeySpace | 100050 | The Space key. | |
KeyPlus | 100051 | The OEM plus key: + (plus sign) and = (equals sign) on the US International layout. | |
KeyComma | 100052 | The OEM comma key: , (comma) and < (left angle bracket) on the US International layout. | |
KeyMinus | 100053 | The OEM minus key: - (minus sign) and _ (underscore) on the US International layout. | |
KeyPeriod | 100054 | The OEM period key: . (period/full stop) and > (right angle bracket) on the US International layout. | |
KeyNum0 | 100055 | The 0 key (numeric pad). | |
KeyNum1 | 100056 | The 1 key (numeric pad). | |
KeyNum2 | 100057 | The 2 key (numeric pad). | |
KeyNum3 | 100058 | The 3 key (numeric pad). | |
KeyNum4 | 100059 | The 4 key (numeric pad). | |
KeyNum5 | 100060 | The 5 key (numeric pad). | |
KeyNum6 | 100061 | The 6 key (numeric pad). | |
KeyNum7 | 100062 | The 7 key (numeric pad). | |
KeyNum8 | 100063 | The 8 key (numeric pad). | |
KeyNum9 | 100064 | The 9 key (numeric pad). | |
KeyNumDecimal | 100065 | The decimal key (numeric pad). | |
KeyNumDivide | 100066 | The / (divide) key (numeric pad). | |
KeyNumMultiply | 100067 | The * (multiply) key (numeric pad). | |
KeyNumMinus | 100068 | The - (subtract) key (numeric pad). | |
KeyNumPlus | 100069 | The + (add) key (numeric pad). | |
KeyNumEnter | 100070 | The Enter key (numeric pad). | |
KeyUpArrow | 100071 | The up arrow key. | |
KeyDownArrow | 100072 | The down arrow key. | |
KeyRightArrow | 100073 | The right arrow key. | |
KeyLeftArrow | 100074 | The left arrow key. | |
KeyInsert | 100075 | The Insert key. | |
KeyDelete | 100076 | The Delete key. | |
KeyHome | 100077 | The Home key. | |
KeyEnd | 100078 | The End key. | |
KeyPageUp | 100079 | The Page Up key. | |
KeyPageDown | 100080 | The Page Down key. | |
KeyF1 | 100081 | The F1 key. | |
KeyF2 | 100082 | The F2 key. | |
KeyF3 | 100083 | The F3 key. | |
KeyF4 | 100084 | The F4 key. | |
KeyF5 | 100085 | The F5 key. | |
KeyF6 | 100086 | The F6 key. | |
KeyF7 | 100087 | The F7 key. | |
KeyF8 | 100088 | The F8 key. | |
KeyF9 | 100089 | The F9 key. | |
KeyF10 | 100090 | The F10 key. | |
KeyF11 | 100091 | The F11 key. | |
KeyF12 | 100092 | The F12 key. | |
KeyF13 | 100093 | The F13 key. | |
KeyF14 | 100094 | The F14 key. | |
KeyF15 | 100095 | The F15 key. | |
KeyF16 | 100096 | The F16 key. | |
KeyF17 | 100097 | The F17 key. | |
KeyF18 | 100098 | The F18 key. | |
KeyF19 | 100099 | The F19 key. | |
KeyF20 | 100100 | The F20 key. | |
KeyF21 | 100101 | The F21 key. | |
KeyF22 | 100102 | The F22 key. | |
KeyF23 | 100103 | The F23 key. | |
KeyF24 | 100104 | The F24 key. | |
KeyRightShift | 100105 | The right Shift key. | |
KeyLeftShift | 100106 | The left Shift key. | |
KeyRightAlt | 100107 | The right Alt (Option on Apple keyboards) key. | |
KeyLeftAlt | 100108 | The left Alt (Option on Apple keyboards) key. | |
KeyRightControl | 100109 | The right Control key. | |
KeyLeftControl | 100110 | The left Control key. | |
KeyRightCommand | 100111 | The right Windows (Command on Apple keyboards) key. | |
KeyLeftCommand | 100112 | The left Windows (Command on Apple keyboards) key. | |
KeyApps | 100113 | The Application key. | |
KeyPrintScreen | 100114 | The Print Screen key. | |
KeyPause | 100115 | The Pause key. | |
KeyCapsLock | 100116 | The CapsLock key. | |
KeyNumLock | 100117 | The NumLock key. | |
KeyScrollLock | 100118 | The ScrollLock key. | |
MouseLeft | 200000 | The left mouse button. | |
MouseRight | 200001 | The right mouse button. | |
MouseMiddle | 200002 | The middle mouse button. | |
MouseFourth | 200003 | The fourth mouse button. | |
MouseFifth | 200004 | The fifth mouse button. | |
MouseSixth | 200005 | The sixth mouse button. | |
MouseSeventh | 200006 | The seventh mouse button. | |
MouseXLeft | 200007 | The derived mouse X- axis. Value is relative mouse movement to the left. Range [0, MaxValue]. | |
MouseXRight | 200008 | The derived mouse X+ axis. Value is relative mouse movement to the right. Range [0, MaxValue]. | |
MouseYUp | 200009 | The derived mouse Y+ axis. Value is relative mouse movement away from the user. Range [0, MaxValue]. | |
MouseYDown | 200010 | The derived mouse Y- axis. Value is relative mouse movement towards the user. Range [0, MaxValue]. | |
MouseWheelUp | 200011 | The derived mouse Z+ axis (the wheel). Value is relative mouse movement away from the user. Range [0, MaxValue]. | |
MouseWheelDown | 200012 | The derived mouse Z- axis (the wheel). Value is relative mouse movement towards the user. Range [0, MaxValue]. | |
MouseX | 200013 | The mouse X axis. Value is relative horizontal mouse movement. Unbounded range ([MinValue, MaxValue]). | |
MouseY | 200014 | The mouse Y axis. Value is relative vertical mouse movement. Unbounded range ([MinValue, MaxValue]). | |
MouseWheel | 200015 | The mouse Z axis (the wheel). Value is relative wheel movement. Unbounded range ([MinValue, MaxValue]). | |
PadLeftStickUp | 300000 | The derived left analog stick Y+ axis. Non-zero when stick moved up/away from the user. Range [0, 1]. | |
PadLeftStickDown | 300001 | The derived left analog stick Y- axis. Non-zero when stick moved down/towards from the user. Range [0, 1]. | |
PadLeftStickLeft | 300002 | The derived left analog stick X- axis. Non-zero when stick moved to the left. Range [0, 1]. | |
PadLeftStickRight | 300003 | The derived left analog stick X+ axis. Non-zero when stick moved to the right. Range [0, 1]. | |
PadLeftStick | 300004 | The gamepad left stick digital button. | |
PadLeftStickX | 300005 | The gamepad left analog stick X axis. Value is position of the stick in the horizontal axis. Range [-1, 1]. | |
PadLeftStickY | 300006 | The gamepad left analog stick Y axis. Value is position of the stick in the vertical axis. Range [-1, 1]. | |
PadRightStickUp | 300007 | The derived right analog stick Y+ axis. Non-zero when stick moved up/away from the user. Range [0, 1]. | |
PadRightStickDown | 300008 | The derived right analog stick Y- axis. Non-zero when stick moved down/towards from the user. Range [0, 1]. | |
PadRightStickLeft | 300009 | The derived right analog stick X- axis. Non-zero when stick moved to the left. Range [0, 1]. | |
PadRightStickRight | 300010 | The derived right analog stick X+ axis. Non-zero when stick moved to the right. Range [0, 1]. | |
PadRightStick | 300011 | The gamepad right stick digital button. | |
PadRightStickX | 300012 | The gamepad right analog stick X axis. Value is position of the stick in the horizontal axis. Range [-1, 1]. | |
PadRightStickY | 300013 | The gamepad right analog stick Y axis. Value is position of the stick in the vertical axis. Range [-1, 1]. | |
PadDPadUp | 300014 | The gamepad up button (DPad). | |
PadDPadDown | 300015 | The gamepad down button (DPad). | |
PadDPadLeft | 300016 | The gamepad left button (DPad). | |
PadDPadRight | 300017 | The gamepad right button (DPad). | |
PadDPadX | 300018 | The derived analog DPad X axis. Value is one of -1 (when PadDPadLeft is pressed), 1 (when PadDPadRight is pressed) or 0 (when neither are pressed). | |
PadDPadY | 300019 | The derived analog DPad Y axis. Value is one of -1 (when PadDPadDown is pressed), 1 (when PadDPadUp is pressed) or 0 (when neither are pressed). | |
PadA | 300020 | The gamepad A button (cross on PS4 gamepads). | |
PadB | 300021 | The gamepad B button (circle on PS4 gamepads). | |
PadX | 300022 | The gamepad X button (square on PS4 gamepads). | |
PadY | 300023 | The gamepad Y button (triangle on PS4 gamepads). | |
PadLeftTrigger | 300024 | The gamepad left trigger analog axis (L2 on PS4 gamepads). Range [0, 1]. | |
PadRightTrigger | 300025 | The gamepad right trigger analog axis (R2 on PS4 gamepads). Range [0, 1]. | |
PadLeftBumper | 300026 | The gamepad left bumper/shoulder digital button (L1 on PS4 gamepads). | |
PadRightBumper | 300027 | The gamepad right bumper/shoulder digital button (R1 on PS4 gamepads). | |
PadBack | 300028 | The gamepad Back (Xbox360), View (XboxOne), Select (PS3) or Share (PS4) digital button. | |
PadStart | 300029 | The gamepad Start (Xbox360/PS3), Menu (XboxOne) or Options (PS4) digital button. |
This enumeration is guaranteed to be forward- and backward-compatible, and so can be safely serialized. InputCodeExt contains few utility extension methods related to InputCode.
Not all codes present here will actually be reported — it highly depends on what the OS and the actual device supports. You should keep that in mind when determining default controls for your game.
Important |
---|
Keyboard codes are based on US International layout. There are several so-called OEM keys which might have different purpose on some layouts (those will be marked in remarks). We currently don't process or expose keyboard layout information, only report the codes as-is, based on what we get from the OS. This might affect accuracy of UI when presenting the keys based on the input codes in localized settings. |
There are three enumerator value ranges:
Additionally, three subranges are available for your use, if you need to store custom codes:
Axes representing digital buttons always report 0 or 1 value. Other axes will report scalar floating point values. The range of analog axis values depends on the axis (for example MouseX range is unbounded, and PadLeftStickX range is [-1, 1]) — see the description of the enumerator for details. Range notation has been used throughout this document as a shorthand: