Input Mapping Reference
Keyboard keycodes, gamepad buttons, and mouse inputs with engine-specific code for Unity, Unreal, and Godot.
Input handling is one of the first things you implement in any game, and every engine has different APIs and naming conventions. This reference covers keyboard, mouse, and gamepad inputs with the exact code for Unity (both old Input Manager and new Input System), Unreal Engine, and Godot.
59 results
| Input ↑ | Type | Unity (Old) | Unity (New) | Unreal | Godot |
|---|---|---|---|---|---|
| 1 | keyboard | Input.GetKeyDown(KeyCode.Alpha1) | Keyboard.current.digit1Key.wasPressedThisFrame | EKeys::One | Input.is_key_pressed(KEY_1) |
| 2 | keyboard | Input.GetKeyDown(KeyCode.Alpha2) | Keyboard.current.digit2Key.wasPressedThisFrame | EKeys::Two | Input.is_key_pressed(KEY_2) |
| 3 | keyboard | Input.GetKeyDown(KeyCode.Alpha3) | Keyboard.current.digit3Key.wasPressedThisFrame | EKeys::Three | Input.is_key_pressed(KEY_3) |
| 4 | keyboard | Input.GetKeyDown(KeyCode.Alpha4) | Keyboard.current.digit4Key.wasPressedThisFrame | EKeys::Four | Input.is_key_pressed(KEY_4) |
| 5 | keyboard | Input.GetKeyDown(KeyCode.Alpha5) | Keyboard.current.digit5Key.wasPressedThisFrame | EKeys::Five | Input.is_key_pressed(KEY_5) |
| A | keyboard | Input.GetKey(KeyCode.A) | Keyboard.current.aKey.isPressed | EKeys::A | Input.is_key_pressed(KEY_A) |
| A Button (Xbox) / Cross | gamepad | Input.GetButtonDown("Jump") | Gamepad.current.buttonSouth.wasPressedThisFrame | EKeys::Gamepad_FaceButton_Bottom | Input.is_joy_button_pressed(0, JOY_BUTTON_A) |
| B Button (Xbox) / Circle | gamepad | Input.GetButtonDown("Cancel") | Gamepad.current.buttonEast.wasPressedThisFrame | EKeys::Gamepad_FaceButton_Right | Input.is_joy_button_pressed(0, JOY_BUTTON_B) |
| Backspace | keyboard | Input.GetKeyDown(KeyCode.Backspace) | Keyboard.current.backspaceKey.wasPressedThisFrame | EKeys::BackSpace | Input.is_key_pressed(KEY_BACKSPACE) |
| C | keyboard | Input.GetKeyDown(KeyCode.C) | Keyboard.current.cKey.wasPressedThisFrame | EKeys::C | Input.is_key_pressed(KEY_C) |
| D | keyboard | Input.GetKey(KeyCode.D) | Keyboard.current.dKey.isPressed | EKeys::D | Input.is_key_pressed(KEY_D) |
| D-Pad Down | gamepad | Input.GetKeyDown(KeyCode.JoystickButton1) | Gamepad.current.dpad.down.wasPressedThisFrame | EKeys::Gamepad_DPad_Down | Input.is_joy_button_pressed(0, JOY_BUTTON_DPAD_DOWN) |
| D-Pad Left | gamepad | Input.GetKeyDown(KeyCode.JoystickButton2) | Gamepad.current.dpad.left.wasPressedThisFrame | EKeys::Gamepad_DPad_Left | Input.is_joy_button_pressed(0, JOY_BUTTON_DPAD_LEFT) |
| D-Pad Right | gamepad | Input.GetKeyDown(KeyCode.JoystickButton3) | Gamepad.current.dpad.right.wasPressedThisFrame | EKeys::Gamepad_DPad_Right | Input.is_joy_button_pressed(0, JOY_BUTTON_DPAD_RIGHT) |
| D-Pad Up | gamepad | Input.GetKeyDown(KeyCode.JoystickButton0) | Gamepad.current.dpad.up.wasPressedThisFrame | EKeys::Gamepad_DPad_Up | Input.is_joy_button_pressed(0, JOY_BUTTON_DPAD_UP) |
| Down Arrow | keyboard | Input.GetKey(KeyCode.DownArrow) | Keyboard.current.downArrowKey.isPressed | EKeys::Down | Input.is_key_pressed(KEY_DOWN) |
| E | keyboard | Input.GetKeyDown(KeyCode.E) | Keyboard.current.eKey.wasPressedThisFrame | EKeys::E | Input.is_key_pressed(KEY_E) |
| Enter / Return | keyboard | Input.GetKeyDown(KeyCode.Return) | Keyboard.current.enterKey.wasPressedThisFrame | EKeys::Enter | Input.is_key_pressed(KEY_ENTER) |
| Escape | keyboard | Input.GetKeyDown(KeyCode.Escape) | Keyboard.current.escapeKey.wasPressedThisFrame | EKeys::Escape | Input.is_key_pressed(KEY_ESCAPE) |
| F | keyboard | Input.GetKeyDown(KeyCode.F) | Keyboard.current.fKey.wasPressedThisFrame | EKeys::F | Input.is_key_pressed(KEY_F) |
| F1 | keyboard | Input.GetKeyDown(KeyCode.F1) | Keyboard.current.f1Key.wasPressedThisFrame | EKeys::F1 | Input.is_key_pressed(KEY_F1) |
| F2 | keyboard | Input.GetKeyDown(KeyCode.F2) | Keyboard.current.f2Key.wasPressedThisFrame | EKeys::F2 | Input.is_key_pressed(KEY_F2) |
| F3 | keyboard | Input.GetKeyDown(KeyCode.F3) | Keyboard.current.f3Key.wasPressedThisFrame | EKeys::F3 | Input.is_key_pressed(KEY_F3) |
| F4 | keyboard | Input.GetKeyDown(KeyCode.F4) | Keyboard.current.f4Key.wasPressedThisFrame | EKeys::F4 | Input.is_key_pressed(KEY_F4) |
| F5 | keyboard | Input.GetKeyDown(KeyCode.F5) | Keyboard.current.f5Key.wasPressedThisFrame | EKeys::F5 | Input.is_key_pressed(KEY_F5) |
| Left Alt | keyboard | Input.GetKey(KeyCode.LeftAlt) | Keyboard.current.leftAltKey.isPressed | EKeys::LeftAlt | Input.is_key_pressed(KEY_ALT) |
| Left Arrow | keyboard | Input.GetKey(KeyCode.LeftArrow) | Keyboard.current.leftArrowKey.isPressed | EKeys::Left | Input.is_key_pressed(KEY_LEFT) |
| Left Bumper (LB / L1) | gamepad | Input.GetButtonDown("Fire1") | Gamepad.current.leftShoulder.wasPressedThisFrame | EKeys::Gamepad_LeftShoulder | Input.is_joy_button_pressed(0, JOY_BUTTON_LEFT_SHOULDER) |
| Left Ctrl | keyboard | Input.GetKey(KeyCode.LeftControl) | Keyboard.current.leftCtrlKey.isPressed | EKeys::LeftControl | Input.is_key_pressed(KEY_CTRL) |
| Left Shift | keyboard | Input.GetKey(KeyCode.LeftShift) | Keyboard.current.leftShiftKey.isPressed | EKeys::LeftShift | Input.is_key_pressed(KEY_SHIFT) |
| Left Stick Press (L3) | gamepad | Input.GetButtonDown("Fire3") | Gamepad.current.leftStickButton.wasPressedThisFrame | EKeys::Gamepad_LeftThumbstick | Input.is_joy_button_pressed(0, JOY_BUTTON_LEFT_STICK) |
| Left Stick X Axis | gamepad | Input.GetAxis("Horizontal") | Gamepad.current.leftStick.ReadValue().x | EKeys::Gamepad_LeftX | Input.get_joy_axis(0, JOY_AXIS_LEFT_X) |
| Left Stick Y Axis | gamepad | Input.GetAxis("Vertical") | Gamepad.current.leftStick.ReadValue().y | EKeys::Gamepad_LeftY | Input.get_joy_axis(0, JOY_AXIS_LEFT_Y) |
| Left Trigger (LT / L2) | gamepad | Input.GetAxis("Fire1") | Gamepad.current.leftTrigger.ReadValue() | EKeys::Gamepad_LeftTrigger | Input.get_joy_axis(0, JOY_AXIS_TRIGGER_LEFT) |
| Mouse Delta | mouse | Input.GetAxis("Mouse X") / Input.GetAxis("Mouse Y") | Mouse.current.delta.ReadValue() | GetInputMouseDelta(DeltaX, DeltaY) | Input.get_last_mouse_velocity() |
| Mouse Left Click | mouse | Input.GetMouseButtonDown(0) | Mouse.current.leftButton.wasPressedThisFrame | EKeys::LeftMouseButton | Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) |
| Mouse Middle Click | mouse | Input.GetMouseButtonDown(2) | Mouse.current.middleButton.wasPressedThisFrame | EKeys::MiddleMouseButton | Input.is_mouse_button_pressed(MOUSE_BUTTON_MIDDLE) |
| Mouse Right Click | mouse | Input.GetMouseButtonDown(1) | Mouse.current.rightButton.wasPressedThisFrame | EKeys::RightMouseButton | Input.is_mouse_button_pressed(MOUSE_BUTTON_RIGHT) |
| Q | keyboard | Input.GetKeyDown(KeyCode.Q) | Keyboard.current.qKey.wasPressedThisFrame | EKeys::Q | Input.is_key_pressed(KEY_Q) |
| R | keyboard | Input.GetKeyDown(KeyCode.R) | Keyboard.current.rKey.wasPressedThisFrame | EKeys::R | Input.is_key_pressed(KEY_R) |
| Right Arrow | keyboard | Input.GetKey(KeyCode.RightArrow) | Keyboard.current.rightArrowKey.isPressed | EKeys::Right | Input.is_key_pressed(KEY_RIGHT) |
| Right Bumper (RB / R1) | gamepad | Input.GetButtonDown("Fire2") | Gamepad.current.rightShoulder.wasPressedThisFrame | EKeys::Gamepad_RightShoulder | Input.is_joy_button_pressed(0, JOY_BUTTON_RIGHT_SHOULDER) |
| Right Stick Press (R3) | gamepad | Input.GetButtonDown("Fire3") | Gamepad.current.rightStickButton.wasPressedThisFrame | EKeys::Gamepad_RightThumbstick | Input.is_joy_button_pressed(0, JOY_BUTTON_RIGHT_STICK) |
| Right Stick X Axis | gamepad | Input.GetAxis("Mouse X") | Gamepad.current.rightStick.ReadValue().x | EKeys::Gamepad_RightX | Input.get_joy_axis(0, JOY_AXIS_RIGHT_X) |
| Right Stick Y Axis | gamepad | Input.GetAxis("Mouse Y") | Gamepad.current.rightStick.ReadValue().y | EKeys::Gamepad_RightY | Input.get_joy_axis(0, JOY_AXIS_RIGHT_Y) |
| Right Trigger (RT / R2) | gamepad | Input.GetAxis("Fire2") | Gamepad.current.rightTrigger.ReadValue() | EKeys::Gamepad_RightTrigger | Input.get_joy_axis(0, JOY_AXIS_TRIGGER_RIGHT) |
| S | keyboard | Input.GetKey(KeyCode.S) | Keyboard.current.sKey.isPressed | EKeys::S | Input.is_key_pressed(KEY_S) |
| Scroll Down | mouse | Input.GetAxis("Mouse ScrollWheel") < 0 | Mouse.current.scroll.ReadValue().y < 0 | EKeys::MouseScrollDown | Input.is_mouse_button_pressed(MOUSE_BUTTON_WHEEL_DOWN) |
| Scroll Up | mouse | Input.GetAxis("Mouse ScrollWheel") > 0 | Mouse.current.scroll.ReadValue().y > 0 | EKeys::MouseScrollUp | Input.is_mouse_button_pressed(MOUSE_BUTTON_WHEEL_UP) |
| Select / Back / View | gamepad | Input.GetButtonDown("Cancel") | Gamepad.current.selectButton.wasPressedThisFrame | EKeys::Gamepad_Special_Left | Input.is_joy_button_pressed(0, JOY_BUTTON_BACK) |
| Space | keyboard | Input.GetKeyDown(KeyCode.Space) | Keyboard.current.spaceKey.wasPressedThisFrame | EKeys::SpaceBar | Input.is_key_pressed(KEY_SPACE) |
| Start / Menu | gamepad | Input.GetButtonDown("Submit") | Gamepad.current.startButton.wasPressedThisFrame | EKeys::Gamepad_Special_Right | Input.is_joy_button_pressed(0, JOY_BUTTON_START) |
| Tab | keyboard | Input.GetKeyDown(KeyCode.Tab) | Keyboard.current.tabKey.wasPressedThisFrame | EKeys::Tab | Input.is_key_pressed(KEY_TAB) |
| Up Arrow | keyboard | Input.GetKey(KeyCode.UpArrow) | Keyboard.current.upArrowKey.isPressed | EKeys::Up | Input.is_key_pressed(KEY_UP) |
| W | keyboard | Input.GetKey(KeyCode.W) | Keyboard.current.wKey.isPressed | EKeys::W | Input.is_key_pressed(KEY_W) |
| X | keyboard | Input.GetKeyDown(KeyCode.X) | Keyboard.current.xKey.wasPressedThisFrame | EKeys::X | Input.is_key_pressed(KEY_X) |
| X Button (Xbox) / Square | gamepad | Input.GetButtonDown("Fire3") | Gamepad.current.buttonWest.wasPressedThisFrame | EKeys::Gamepad_FaceButton_Left | Input.is_joy_button_pressed(0, JOY_BUTTON_X) |
| Y Button (Xbox) / Triangle | gamepad | Input.GetButtonDown("Fire2") | Gamepad.current.buttonNorth.wasPressedThisFrame | EKeys::Gamepad_FaceButton_Top | Input.is_joy_button_pressed(0, JOY_BUTTON_Y) |
| Z | keyboard | Input.GetKeyDown(KeyCode.Z) | Keyboard.current.zKey.wasPressedThisFrame | EKeys::Z | Input.is_key_pressed(KEY_Z) |
Related Tools
Scripting Order
Interactive Unity MonoBehaviour lifecycle diagram. When does Awake, Start, Update, and every callback run.
Platform Capabilities
Which platforms support haptics, HDR, ray tracing, VRR, and more. Filterable matrix.
Game Maths
Interactive cheat sheet with live visualisations. Distance, lerp, dot product, vectors, and more with Unity C# code.