Game Dev Cheat Sheet

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.

Category:
Engine columns:

59 results

InputTypeUnity (Old)Unity (New)UnrealGodot
1keyboard
Input.GetKeyDown(KeyCode.Alpha1)
Keyboard.current.digit1Key.wasPressedThisFrame
EKeys::One
Input.is_key_pressed(KEY_1)
2keyboard
Input.GetKeyDown(KeyCode.Alpha2)
Keyboard.current.digit2Key.wasPressedThisFrame
EKeys::Two
Input.is_key_pressed(KEY_2)
3keyboard
Input.GetKeyDown(KeyCode.Alpha3)
Keyboard.current.digit3Key.wasPressedThisFrame
EKeys::Three
Input.is_key_pressed(KEY_3)
4keyboard
Input.GetKeyDown(KeyCode.Alpha4)
Keyboard.current.digit4Key.wasPressedThisFrame
EKeys::Four
Input.is_key_pressed(KEY_4)
5keyboard
Input.GetKeyDown(KeyCode.Alpha5)
Keyboard.current.digit5Key.wasPressedThisFrame
EKeys::Five
Input.is_key_pressed(KEY_5)
Akeyboard
Input.GetKey(KeyCode.A)
Keyboard.current.aKey.isPressed
EKeys::A
Input.is_key_pressed(KEY_A)
A Button (Xbox) / Crossgamepad
Input.GetButtonDown("Jump")
Gamepad.current.buttonSouth.wasPressedThisFrame
EKeys::Gamepad_FaceButton_Bottom
Input.is_joy_button_pressed(0, JOY_BUTTON_A)
B Button (Xbox) / Circlegamepad
Input.GetButtonDown("Cancel")
Gamepad.current.buttonEast.wasPressedThisFrame
EKeys::Gamepad_FaceButton_Right
Input.is_joy_button_pressed(0, JOY_BUTTON_B)
Backspacekeyboard
Input.GetKeyDown(KeyCode.Backspace)
Keyboard.current.backspaceKey.wasPressedThisFrame
EKeys::BackSpace
Input.is_key_pressed(KEY_BACKSPACE)
Ckeyboard
Input.GetKeyDown(KeyCode.C)
Keyboard.current.cKey.wasPressedThisFrame
EKeys::C
Input.is_key_pressed(KEY_C)
Dkeyboard
Input.GetKey(KeyCode.D)
Keyboard.current.dKey.isPressed
EKeys::D
Input.is_key_pressed(KEY_D)
D-Pad Downgamepad
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 Leftgamepad
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 Rightgamepad
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 Upgamepad
Input.GetKeyDown(KeyCode.JoystickButton0)
Gamepad.current.dpad.up.wasPressedThisFrame
EKeys::Gamepad_DPad_Up
Input.is_joy_button_pressed(0, JOY_BUTTON_DPAD_UP)
Down Arrowkeyboard
Input.GetKey(KeyCode.DownArrow)
Keyboard.current.downArrowKey.isPressed
EKeys::Down
Input.is_key_pressed(KEY_DOWN)
Ekeyboard
Input.GetKeyDown(KeyCode.E)
Keyboard.current.eKey.wasPressedThisFrame
EKeys::E
Input.is_key_pressed(KEY_E)
Enter / Returnkeyboard
Input.GetKeyDown(KeyCode.Return)
Keyboard.current.enterKey.wasPressedThisFrame
EKeys::Enter
Input.is_key_pressed(KEY_ENTER)
Escapekeyboard
Input.GetKeyDown(KeyCode.Escape)
Keyboard.current.escapeKey.wasPressedThisFrame
EKeys::Escape
Input.is_key_pressed(KEY_ESCAPE)
Fkeyboard
Input.GetKeyDown(KeyCode.F)
Keyboard.current.fKey.wasPressedThisFrame
EKeys::F
Input.is_key_pressed(KEY_F)
F1keyboard
Input.GetKeyDown(KeyCode.F1)
Keyboard.current.f1Key.wasPressedThisFrame
EKeys::F1
Input.is_key_pressed(KEY_F1)
F2keyboard
Input.GetKeyDown(KeyCode.F2)
Keyboard.current.f2Key.wasPressedThisFrame
EKeys::F2
Input.is_key_pressed(KEY_F2)
F3keyboard
Input.GetKeyDown(KeyCode.F3)
Keyboard.current.f3Key.wasPressedThisFrame
EKeys::F3
Input.is_key_pressed(KEY_F3)
F4keyboard
Input.GetKeyDown(KeyCode.F4)
Keyboard.current.f4Key.wasPressedThisFrame
EKeys::F4
Input.is_key_pressed(KEY_F4)
F5keyboard
Input.GetKeyDown(KeyCode.F5)
Keyboard.current.f5Key.wasPressedThisFrame
EKeys::F5
Input.is_key_pressed(KEY_F5)
Left Altkeyboard
Input.GetKey(KeyCode.LeftAlt)
Keyboard.current.leftAltKey.isPressed
EKeys::LeftAlt
Input.is_key_pressed(KEY_ALT)
Left Arrowkeyboard
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 Ctrlkeyboard
Input.GetKey(KeyCode.LeftControl)
Keyboard.current.leftCtrlKey.isPressed
EKeys::LeftControl
Input.is_key_pressed(KEY_CTRL)
Left Shiftkeyboard
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 Axisgamepad
Input.GetAxis("Horizontal")
Gamepad.current.leftStick.ReadValue().x
EKeys::Gamepad_LeftX
Input.get_joy_axis(0, JOY_AXIS_LEFT_X)
Left Stick Y Axisgamepad
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 Deltamouse
Input.GetAxis("Mouse X") / Input.GetAxis("Mouse Y")
Mouse.current.delta.ReadValue()
GetInputMouseDelta(DeltaX, DeltaY)
Input.get_last_mouse_velocity()
Mouse Left Clickmouse
Input.GetMouseButtonDown(0)
Mouse.current.leftButton.wasPressedThisFrame
EKeys::LeftMouseButton
Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT)
Mouse Middle Clickmouse
Input.GetMouseButtonDown(2)
Mouse.current.middleButton.wasPressedThisFrame
EKeys::MiddleMouseButton
Input.is_mouse_button_pressed(MOUSE_BUTTON_MIDDLE)
Mouse Right Clickmouse
Input.GetMouseButtonDown(1)
Mouse.current.rightButton.wasPressedThisFrame
EKeys::RightMouseButton
Input.is_mouse_button_pressed(MOUSE_BUTTON_RIGHT)
Qkeyboard
Input.GetKeyDown(KeyCode.Q)
Keyboard.current.qKey.wasPressedThisFrame
EKeys::Q
Input.is_key_pressed(KEY_Q)
Rkeyboard
Input.GetKeyDown(KeyCode.R)
Keyboard.current.rKey.wasPressedThisFrame
EKeys::R
Input.is_key_pressed(KEY_R)
Right Arrowkeyboard
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 Axisgamepad
Input.GetAxis("Mouse X")
Gamepad.current.rightStick.ReadValue().x
EKeys::Gamepad_RightX
Input.get_joy_axis(0, JOY_AXIS_RIGHT_X)
Right Stick Y Axisgamepad
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)
Skeyboard
Input.GetKey(KeyCode.S)
Keyboard.current.sKey.isPressed
EKeys::S
Input.is_key_pressed(KEY_S)
Scroll Downmouse
Input.GetAxis("Mouse ScrollWheel") < 0
Mouse.current.scroll.ReadValue().y < 0
EKeys::MouseScrollDown
Input.is_mouse_button_pressed(MOUSE_BUTTON_WHEEL_DOWN)
Scroll Upmouse
Input.GetAxis("Mouse ScrollWheel") > 0
Mouse.current.scroll.ReadValue().y > 0
EKeys::MouseScrollUp
Input.is_mouse_button_pressed(MOUSE_BUTTON_WHEEL_UP)
Select / Back / Viewgamepad
Input.GetButtonDown("Cancel")
Gamepad.current.selectButton.wasPressedThisFrame
EKeys::Gamepad_Special_Left
Input.is_joy_button_pressed(0, JOY_BUTTON_BACK)
Spacekeyboard
Input.GetKeyDown(KeyCode.Space)
Keyboard.current.spaceKey.wasPressedThisFrame
EKeys::SpaceBar
Input.is_key_pressed(KEY_SPACE)
Start / Menugamepad
Input.GetButtonDown("Submit")
Gamepad.current.startButton.wasPressedThisFrame
EKeys::Gamepad_Special_Right
Input.is_joy_button_pressed(0, JOY_BUTTON_START)
Tabkeyboard
Input.GetKeyDown(KeyCode.Tab)
Keyboard.current.tabKey.wasPressedThisFrame
EKeys::Tab
Input.is_key_pressed(KEY_TAB)
Up Arrowkeyboard
Input.GetKey(KeyCode.UpArrow)
Keyboard.current.upArrowKey.isPressed
EKeys::Up
Input.is_key_pressed(KEY_UP)
Wkeyboard
Input.GetKey(KeyCode.W)
Keyboard.current.wKey.isPressed
EKeys::W
Input.is_key_pressed(KEY_W)
Xkeyboard
Input.GetKeyDown(KeyCode.X)
Keyboard.current.xKey.wasPressedThisFrame
EKeys::X
Input.is_key_pressed(KEY_X)
X Button (Xbox) / Squaregamepad
Input.GetButtonDown("Fire3")
Gamepad.current.buttonWest.wasPressedThisFrame
EKeys::Gamepad_FaceButton_Left
Input.is_joy_button_pressed(0, JOY_BUTTON_X)
Y Button (Xbox) / Trianglegamepad
Input.GetButtonDown("Fire2")
Gamepad.current.buttonNorth.wasPressedThisFrame
EKeys::Gamepad_FaceButton_Top
Input.is_joy_button_pressed(0, JOY_BUTTON_Y)
Zkeyboard
Input.GetKeyDown(KeyCode.Z)
Keyboard.current.zKey.wasPressedThisFrame
EKeys::Z
Input.is_key_pressed(KEY_Z)