Click or drag to resize

InputCode Enumeration

[This is preliminary documentation and is subject to change.]

Platform- and device-independent virtual axis codes.

Namespace:  RavingBots.MultiInput
Assembly:  RavingBots.MultiInput (in RavingBots.MultiInput.dll) Version: 0.12
Syntax
C#
public enum InputCode
Members
  Member nameValueDescription
None0 Value reserved for unknown codes or uninitialized variables.
Key0100000 The 0 key (alphanumeric).
Key1100001 The 1 key (alphanumeric).
Key2100002 The 2 key (alphanumeric).
Key3100003 The 3 key (alphanumeric).
Key4100004 The 4 key (alphanumeric).
Key5100005 The 5 key (alphanumeric).
Key6100006 The 6 key (alphanumeric).
Key7100007 The 7 key (alphanumeric).
Key8100008 The 8 key (alphanumeric).
Key9100009 The 9 key (alphanumeric).
KeyA100010 The A key.
KeyB100011 The B key.
KeyC100012 The C key.
KeyD100013 The D key.
KeyE100014 The E key.
KeyF100015 The F key.
KeyG100016 The G key.
KeyH100017 The H key.
KeyI100018 The I key.
KeyJ100019 The J key.
KeyK100020 The K key.
KeyL100021 The L key.
KeyM100022 The M key.
KeyN100023 The N key.
KeyO100024 The O key.
KeyP100025 The P key.
KeyQ100026 The Q key.
KeyR100027 The R key.
KeyS100028 The S key.
KeyT100029 The T key.
KeyU100030 The U key.
KeyV100031 The V key.
KeyW100032 The W key.
KeyX100033 The X key.
KeyY100034 The Y key.
KeyZ100035 The Z key.
KeySemicolon100036 The OEM 1 key: ; (semicolon) and : (colon) on the US International layout.
KeySlash100037 The OEM 2 key: / (slash) and ? (question mark) on the US International layout.
KeyAccent100038 The OEM 3 key: ` (grave accent/backtick) and ~ (tilde) on the US International layout.
KeyLeftBracket100039 The OEM 4 key: [ (left bracket) and { (left brace) on the US International layout.
KeyBackslash100040 The OEM 5 key: \ (backslash) and | (vertical bar/pipe) on the US International layout.
KeyRightBracket100041 The OEM 6 key: ] (right bracket) and } (right brace) on the US International layout.
KeyQuote100042 The OEM 7 key: ' (apostrophe/single quote) and " (double quote) on the US International layout.
KeyOem8100043 The OEM 8 key: not present on the US International layout.
KeyOem102100044 The OEM 102 key: additional KeyBackslash on the US International layout.
KeyBackspace100045 The Backspace key.
KeyTab100046 The Tab key.
KeyClear100047 The Clear key (Apple keyboards).
KeyEnter100048 The primary Enter key.
KeyEscape100049 The Escape key.
KeySpace100050 The Space key.
KeyPlus100051 The OEM plus key: + (plus sign) and = (equals sign) on the US International layout.
KeyComma100052 The OEM comma key: , (comma) and < (left angle bracket) on the US International layout.
KeyMinus100053 The OEM minus key: - (minus sign) and _ (underscore) on the US International layout.
KeyPeriod100054 The OEM period key: . (period/full stop) and > (right angle bracket) on the US International layout.
KeyNum0100055 The 0 key (numeric pad).
KeyNum1100056 The 1 key (numeric pad).
KeyNum2100057 The 2 key (numeric pad).
KeyNum3100058 The 3 key (numeric pad).
KeyNum4100059 The 4 key (numeric pad).
KeyNum5100060 The 5 key (numeric pad).
KeyNum6100061 The 6 key (numeric pad).
KeyNum7100062 The 7 key (numeric pad).
KeyNum8100063 The 8 key (numeric pad).
KeyNum9100064 The 9 key (numeric pad).
KeyNumDecimal100065 The decimal key (numeric pad).
KeyNumDivide100066 The / (divide) key (numeric pad).
KeyNumMultiply100067 The * (multiply) key (numeric pad).
KeyNumMinus100068 The - (subtract) key (numeric pad).
KeyNumPlus100069 The + (add) key (numeric pad).
KeyNumEnter100070 The Enter key (numeric pad).
KeyUpArrow100071 The up arrow key.
KeyDownArrow100072 The down arrow key.
KeyRightArrow100073 The right arrow key.
KeyLeftArrow100074 The left arrow key.
KeyInsert100075 The Insert key.
KeyDelete100076 The Delete key.
KeyHome100077 The Home key.
KeyEnd100078 The End key.
KeyPageUp100079 The Page Up key.
KeyPageDown100080 The Page Down key.
KeyF1100081 The F1 key.
KeyF2100082 The F2 key.
KeyF3100083 The F3 key.
KeyF4100084 The F4 key.
KeyF5100085 The F5 key.
KeyF6100086 The F6 key.
KeyF7100087 The F7 key.
KeyF8100088 The F8 key.
KeyF9100089 The F9 key.
KeyF10100090 The F10 key.
KeyF11100091 The F11 key.
KeyF12100092 The F12 key.
KeyF13100093 The F13 key.
KeyF14100094 The F14 key.
KeyF15100095 The F15 key.
KeyF16100096 The F16 key.
KeyF17100097 The F17 key.
KeyF18100098 The F18 key.
KeyF19100099 The F19 key.
KeyF20100100 The F20 key.
KeyF21100101 The F21 key.
KeyF22100102 The F22 key.
KeyF23100103 The F23 key.
KeyF24100104 The F24 key.
KeyRightShift100105 The right Shift key.
KeyLeftShift100106 The left Shift key.
KeyRightAlt100107 The right Alt (Option on Apple keyboards) key.
KeyLeftAlt100108 The left Alt (Option on Apple keyboards) key.
KeyRightControl100109 The right Control key.
KeyLeftControl100110 The left Control key.
KeyRightCommand100111 The right Windows (Command on Apple keyboards) key.
KeyLeftCommand100112 The left Windows (Command on Apple keyboards) key.
KeyApps100113 The Application key.
KeyPrintScreen100114 The Print Screen key.
KeyPause100115 The Pause key.
KeyCapsLock100116 The CapsLock key.
KeyNumLock100117 The NumLock key.
KeyScrollLock100118 The ScrollLock key.
MouseLeft200000 The left mouse button.
MouseRight200001 The right mouse button.
MouseMiddle200002 The middle mouse button.
MouseFourth200003 The fourth mouse button.
MouseFifth200004 The fifth mouse button.
MouseSixth200005 The sixth mouse button.
MouseSeventh200006 The seventh mouse button.
MouseXLeft200007 The derived mouse X- axis. Value is relative mouse movement to the left. Range [0, MaxValue].
MouseXRight200008 The derived mouse X+ axis. Value is relative mouse movement to the right. Range [0, MaxValue].
MouseYUp200009 The derived mouse Y+ axis. Value is relative mouse movement away from the user. Range [0, MaxValue].
MouseYDown200010 The derived mouse Y- axis. Value is relative mouse movement towards the user. Range [0, MaxValue].
MouseWheelUp200011 The derived mouse Z+ axis (the wheel). Value is relative mouse movement away from the user. Range [0, MaxValue].
MouseWheelDown200012 The derived mouse Z- axis (the wheel). Value is relative mouse movement towards the user. Range [0, MaxValue].
MouseX200013 The mouse X axis. Value is relative horizontal mouse movement. Unbounded range ([MinValue, MaxValue]).
MouseY200014 The mouse Y axis. Value is relative vertical mouse movement. Unbounded range ([MinValue, MaxValue]).
MouseWheel200015 The mouse Z axis (the wheel). Value is relative wheel movement. Unbounded range ([MinValue, MaxValue]).
PadLeftStickUp300000 The derived left analog stick Y+ axis. Non-zero when stick moved up/away from the user. Range [0, 1].
PadLeftStickDown300001 The derived left analog stick Y- axis. Non-zero when stick moved down/towards from the user. Range [0, 1].
PadLeftStickLeft300002 The derived left analog stick X- axis. Non-zero when stick moved to the left. Range [0, 1].
PadLeftStickRight300003 The derived left analog stick X+ axis. Non-zero when stick moved to the right. Range [0, 1].
PadLeftStick300004 The gamepad left stick digital button.
PadLeftStickX300005 The gamepad left analog stick X axis. Value is position of the stick in the horizontal axis. Range [-1, 1].
PadLeftStickY300006 The gamepad left analog stick Y axis. Value is position of the stick in the vertical axis. Range [-1, 1].
PadRightStickUp300007 The derived right analog stick Y+ axis. Non-zero when stick moved up/away from the user. Range [0, 1].
PadRightStickDown300008 The derived right analog stick Y- axis. Non-zero when stick moved down/towards from the user. Range [0, 1].
PadRightStickLeft300009 The derived right analog stick X- axis. Non-zero when stick moved to the left. Range [0, 1].
PadRightStickRight300010 The derived right analog stick X+ axis. Non-zero when stick moved to the right. Range [0, 1].
PadRightStick300011 The gamepad right stick digital button.
PadRightStickX300012 The gamepad right analog stick X axis. Value is position of the stick in the horizontal axis. Range [-1, 1].
PadRightStickY300013 The gamepad right analog stick Y axis. Value is position of the stick in the vertical axis. Range [-1, 1].
PadDPadUp300014 The gamepad up button (DPad).
PadDPadDown300015 The gamepad down button (DPad).
PadDPadLeft300016 The gamepad left button (DPad).
PadDPadRight300017 The gamepad right button (DPad).
PadDPadX300018 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).
PadDPadY300019 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).
PadA300020 The gamepad A button (cross on PS4 gamepads).
PadB300021 The gamepad B button (circle on PS4 gamepads).
PadX300022 The gamepad X button (square on PS4 gamepads).
PadY300023 The gamepad Y button (triangle on PS4 gamepads).
PadLeftTrigger300024 The gamepad left trigger analog axis (L2 on PS4 gamepads). Range [0, 1].
PadRightTrigger300025 The gamepad right trigger analog axis (R2 on PS4 gamepads). Range [0, 1].
PadLeftBumper300026 The gamepad left bumper/shoulder digital button (L1 on PS4 gamepads).
PadRightBumper300027 The gamepad right bumper/shoulder digital button (R1 on PS4 gamepads).
PadBack300028 The gamepad Back (Xbox360), View (XboxOne), Select (PS3) or Share (PS4) digital button.
PadStart300029 The gamepad Start (Xbox360/PS3), Menu (XboxOne) or Options (PS4) digital button.
Remarks

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 note 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:

  • [x, y] means "from x (inclusive) to y (inclusive)"
  • [x, y) means "from x (inclusive) to y (exclusive)"
  • (x, y] means "from x (exclusive) to y (inclusive)"
  • (x, y) means "from x (exclusive) to y (exclusive)"
See Also