Game Dev Cheat Sheet

Unity Input Mapping Reference

Keyboard keycodes, gamepad buttons, and mouse inputs with engine-specific code for Unity, Unreal, and Godot.

Input mapping is the association between physical inputs (keyboard keys, mouse buttons, and gamepad sticks or triggers) and the in-game actions they trigger. 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:

59 results

1keyboard

Weapon or ability slot 1.

Unity (Old)
Input.GetKeyDown(KeyCode.Alpha1)
Unity (New)
Keyboard.current.digit1Key.wasPressedThisFrame
Unreal
EKeys::One
Godot
Input.is_key_pressed(KEY_1)
2keyboard

Weapon or ability slot 2.

Unity (Old)
Input.GetKeyDown(KeyCode.Alpha2)
Unity (New)
Keyboard.current.digit2Key.wasPressedThisFrame
Unreal
EKeys::Two
Godot
Input.is_key_pressed(KEY_2)
3keyboard

Weapon or ability slot 3.

Unity (Old)
Input.GetKeyDown(KeyCode.Alpha3)
Unity (New)
Keyboard.current.digit3Key.wasPressedThisFrame
Unreal
EKeys::Three
Godot
Input.is_key_pressed(KEY_3)
4keyboard

Weapon or ability slot 4.

Unity (Old)
Input.GetKeyDown(KeyCode.Alpha4)
Unity (New)
Keyboard.current.digit4Key.wasPressedThisFrame
Unreal
EKeys::Four
Godot
Input.is_key_pressed(KEY_4)
5keyboard

Weapon or ability slot 5.

Unity (Old)
Input.GetKeyDown(KeyCode.Alpha5)
Unity (New)
Keyboard.current.digit5Key.wasPressedThisFrame
Unreal
EKeys::Five
Godot
Input.is_key_pressed(KEY_5)
Akeyboard

Left in WASD layout.

Unity (Old)
Input.GetKey(KeyCode.A)
Unity (New)
Keyboard.current.aKey.isPressed
Unreal
EKeys::A
Godot
Input.is_key_pressed(KEY_A)
A Button (Xbox) / Crossgamepad

South face button. Jump or confirm.

Unity (Old)
Input.GetButtonDown("Jump")
Unity (New)
Gamepad.current.buttonSouth.wasPressedThisFrame
Unreal
EKeys::Gamepad_FaceButton_Bottom
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_A)
B Button (Xbox) / Circlegamepad

East face button. Cancel or dodge.

Unity (Old)
Input.GetButtonDown("Cancel")
Unity (New)
Gamepad.current.buttonEast.wasPressedThisFrame
Unreal
EKeys::Gamepad_FaceButton_Right
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_B)
Backspacekeyboard

Delete character in text input.

Unity (Old)
Input.GetKeyDown(KeyCode.Backspace)
Unity (New)
Keyboard.current.backspaceKey.wasPressedThisFrame
Unreal
EKeys::BackSpace
Godot
Input.is_key_pressed(KEY_BACKSPACE)
Ckeyboard

Crouch or toggle camera.

Unity (Old)
Input.GetKeyDown(KeyCode.C)
Unity (New)
Keyboard.current.cKey.wasPressedThisFrame
Unreal
EKeys::C
Godot
Input.is_key_pressed(KEY_C)
Dkeyboard

Right in WASD layout.

Unity (Old)
Input.GetKey(KeyCode.D)
Unity (New)
Keyboard.current.dKey.isPressed
Unreal
EKeys::D
Godot
Input.is_key_pressed(KEY_D)
D-Pad Downgamepad

Old Input D-Pad requires manual axis setup in Project Settings > Input Manager. Use the New Input System for reliable D-Pad support.

Unity (Old)
Input.GetAxis("DPad_YAxis") < 0
// Requires manual axis setup in Input Manager
// Button indices vary by platform
Unity (New)
Gamepad.current.dpad.down.wasPressedThisFrame
Unreal
EKeys::Gamepad_DPad_Down
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_DPAD_DOWN)
D-Pad Leftgamepad

Old Input D-Pad requires manual axis setup in Project Settings > Input Manager. Use the New Input System for reliable D-Pad support.

Unity (Old)
Input.GetAxis("DPad_XAxis") < 0
// Requires manual axis setup in Input Manager
// Button indices vary by platform
Unity (New)
Gamepad.current.dpad.left.wasPressedThisFrame
Unreal
EKeys::Gamepad_DPad_Left
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_DPAD_LEFT)
D-Pad Rightgamepad

Old Input D-Pad requires manual axis setup in Project Settings > Input Manager. Use the New Input System for reliable D-Pad support.

Unity (Old)
Input.GetAxis("DPad_XAxis") > 0
// Requires manual axis setup in Input Manager
// Button indices vary by platform
Unity (New)
Gamepad.current.dpad.right.wasPressedThisFrame
Unreal
EKeys::Gamepad_DPad_Right
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_DPAD_RIGHT)
D-Pad Upgamepad

Old Input D-Pad requires manual axis setup in Project Settings > Input Manager. Use the New Input System for reliable D-Pad support.

Unity (Old)
Input.GetAxis("DPad_YAxis") > 0
// Requires manual axis setup in Input Manager
// Button indices vary by platform
Unity (New)
Gamepad.current.dpad.up.wasPressedThisFrame
Unreal
EKeys::Gamepad_DPad_Up
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_DPAD_UP)
Down Arrowkeyboard

Directional input.

Unity (Old)
Input.GetKey(KeyCode.DownArrow)
Unity (New)
Keyboard.current.downArrowKey.isPressed
Unreal
EKeys::Down
Godot
Input.is_key_pressed(KEY_DOWN)
Ekeyboard

Interact or lean right.

Unity (Old)
Input.GetKeyDown(KeyCode.E)
Unity (New)
Keyboard.current.eKey.wasPressedThisFrame
Unreal
EKeys::E
Godot
Input.is_key_pressed(KEY_E)
Enter / Returnkeyboard

Submit or confirm action.

Unity (Old)
Input.GetKeyDown(KeyCode.Return)
Unity (New)
Keyboard.current.enterKey.wasPressedThisFrame
Unreal
EKeys::Enter
Godot
Input.is_key_pressed(KEY_ENTER)
Escapekeyboard

Pause menu or cancel.

Unity (Old)
Input.GetKeyDown(KeyCode.Escape)
Unity (New)
Keyboard.current.escapeKey.wasPressedThisFrame
Unreal
EKeys::Escape
Godot
Input.is_key_pressed(KEY_ESCAPE)
Fkeyboard

Flashlight, interact, or melee.

Unity (Old)
Input.GetKeyDown(KeyCode.F)
Unity (New)
Keyboard.current.fKey.wasPressedThisFrame
Unreal
EKeys::F
Godot
Input.is_key_pressed(KEY_F)
F1keyboard

Help or debug overlay.

Unity (Old)
Input.GetKeyDown(KeyCode.F1)
Unity (New)
Keyboard.current.f1Key.wasPressedThisFrame
Unreal
EKeys::F1
Godot
Input.is_key_pressed(KEY_F1)
F2keyboard

Rename or secondary debug.

Unity (Old)
Input.GetKeyDown(KeyCode.F2)
Unity (New)
Keyboard.current.f2Key.wasPressedThisFrame
Unreal
EKeys::F2
Godot
Input.is_key_pressed(KEY_F2)
F3keyboard

Debug info toggle.

Unity (Old)
Input.GetKeyDown(KeyCode.F3)
Unity (New)
Keyboard.current.f3Key.wasPressedThisFrame
Unreal
EKeys::F3
Godot
Input.is_key_pressed(KEY_F3)
F4keyboard

Alt+F4 closes window on some platforms.

Unity (Old)
Input.GetKeyDown(KeyCode.F4)
Unity (New)
Keyboard.current.f4Key.wasPressedThisFrame
Unreal
EKeys::F4
Godot
Input.is_key_pressed(KEY_F4)
F5keyboard

Quick-save in many games.

Unity (Old)
Input.GetKeyDown(KeyCode.F5)
Unity (New)
Keyboard.current.f5Key.wasPressedThisFrame
Unreal
EKeys::F5
Godot
Input.is_key_pressed(KEY_F5)
Left Altkeyboard

Walk or modifier key.

Unity (Old)
Input.GetKey(KeyCode.LeftAlt)
Unity (New)
Keyboard.current.leftAltKey.isPressed
Unreal
EKeys::LeftAlt
Godot
Input.is_key_pressed(KEY_ALT)
Left Arrowkeyboard

Directional input.

Unity (Old)
Input.GetKey(KeyCode.LeftArrow)
Unity (New)
Keyboard.current.leftArrowKey.isPressed
Unreal
EKeys::Left
Godot
Input.is_key_pressed(KEY_LEFT)
Left Bumper (LB / L1)gamepad

Left shoulder button.

Unity (Old)
Input.GetButtonDown("Fire1")
Unity (New)
Gamepad.current.leftShoulder.wasPressedThisFrame
Unreal
EKeys::Gamepad_LeftShoulder
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_LEFT_SHOULDER)
Left Ctrlkeyboard

Crouch or modifier key.

Unity (Old)
Input.GetKey(KeyCode.LeftControl)
Unity (New)
Keyboard.current.leftCtrlKey.isPressed
Unreal
EKeys::LeftControl
Godot
Input.is_key_pressed(KEY_CTRL)
Left Shiftkeyboard

Sprint or crouch modifier.

Unity (Old)
Input.GetKey(KeyCode.LeftShift)
Unity (New)
Keyboard.current.leftShiftKey.isPressed
Unreal
EKeys::LeftShift
Godot
Input.is_key_pressed(KEY_SHIFT)
Left Stick Press (L3)gamepad

Click the left thumbstick. Sprint toggle.

Unity (Old)
Input.GetButtonDown("Fire3")
Unity (New)
Gamepad.current.leftStickButton.wasPressedThisFrame
Unreal
EKeys::Gamepad_LeftThumbstick
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_LEFT_STICK)
Left Stick X Axisgamepad

Horizontal movement. Returns -1 to 1.

Unity (Old)
Input.GetAxis("Horizontal")
Unity (New)
Gamepad.current.leftStick.ReadValue().x
Unreal
EKeys::Gamepad_LeftX
Godot
Input.get_joy_axis(0, JOY_AXIS_LEFT_X)
Left Stick Y Axisgamepad

Vertical movement. Returns -1 to 1.

Unity (Old)
Input.GetAxis("Vertical")
Unity (New)
Gamepad.current.leftStick.ReadValue().y
Unreal
EKeys::Gamepad_LeftY
Godot
Input.get_joy_axis(0, JOY_AXIS_LEFT_Y)
Left Trigger (LT / L2)gamepad

Analogue trigger. Returns 0 to 1.

Unity (Old)
Input.GetAxis("Fire1")
Unity (New)
Gamepad.current.leftTrigger.ReadValue()
Unreal
EKeys::Gamepad_LeftTrigger
Godot
Input.get_joy_axis(0, JOY_AXIS_TRIGGER_LEFT)
Mouse Deltamouse

Camera look. Raw pixel movement per frame.

Unity (Old)
Input.GetAxis("Mouse X") / Input.GetAxis("Mouse Y")
Unity (New)
Mouse.current.delta.ReadValue()
Unreal
GetInputMouseDelta(DeltaX, DeltaY)
Godot
Input.get_last_mouse_velocity()
Mouse Left Clickmouse

Primary fire or select.

Unity (Old)
Input.GetMouseButtonDown(0)
Unity (New)
Mouse.current.leftButton.wasPressedThisFrame
Unreal
EKeys::LeftMouseButton
Godot
Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT)
Mouse Middle Clickmouse

Ping or third action.

Unity (Old)
Input.GetMouseButtonDown(2)
Unity (New)
Mouse.current.middleButton.wasPressedThisFrame
Unreal
EKeys::MiddleMouseButton
Godot
Input.is_mouse_button_pressed(MOUSE_BUTTON_MIDDLE)
Mouse Right Clickmouse

Aim down sights or secondary action.

Unity (Old)
Input.GetMouseButtonDown(1)
Unity (New)
Mouse.current.rightButton.wasPressedThisFrame
Unreal
EKeys::RightMouseButton
Godot
Input.is_mouse_button_pressed(MOUSE_BUTTON_RIGHT)
Qkeyboard

Ability or lean left.

Unity (Old)
Input.GetKeyDown(KeyCode.Q)
Unity (New)
Keyboard.current.qKey.wasPressedThisFrame
Unreal
EKeys::Q
Godot
Input.is_key_pressed(KEY_Q)
Rkeyboard

Reload in shooters.

Unity (Old)
Input.GetKeyDown(KeyCode.R)
Unity (New)
Keyboard.current.rKey.wasPressedThisFrame
Unreal
EKeys::R
Godot
Input.is_key_pressed(KEY_R)
Right Arrowkeyboard

Directional input.

Unity (Old)
Input.GetKey(KeyCode.RightArrow)
Unity (New)
Keyboard.current.rightArrowKey.isPressed
Unreal
EKeys::Right
Godot
Input.is_key_pressed(KEY_RIGHT)
Right Bumper (RB / R1)gamepad

Right shoulder button.

Unity (Old)
Input.GetButtonDown("Fire2")
Unity (New)
Gamepad.current.rightShoulder.wasPressedThisFrame
Unreal
EKeys::Gamepad_RightShoulder
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_RIGHT_SHOULDER)
Right Stick Press (R3)gamepad

Click the right thumbstick. Melee or zoom.

Unity (Old)
Input.GetButtonDown("Fire3")
Unity (New)
Gamepad.current.rightStickButton.wasPressedThisFrame
Unreal
EKeys::Gamepad_RightThumbstick
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_RIGHT_STICK)
Right Stick X Axisgamepad

Camera horizontal. Returns -1 to 1.

Unity (Old)
Input.GetAxis("Mouse X")
Unity (New)
Gamepad.current.rightStick.ReadValue().x
Unreal
EKeys::Gamepad_RightX
Godot
Input.get_joy_axis(0, JOY_AXIS_RIGHT_X)
Right Stick Y Axisgamepad

Camera vertical. Returns -1 to 1.

Unity (Old)
Input.GetAxis("Mouse Y")
Unity (New)
Gamepad.current.rightStick.ReadValue().y
Unreal
EKeys::Gamepad_RightY
Godot
Input.get_joy_axis(0, JOY_AXIS_RIGHT_Y)
Right Trigger (RT / R2)gamepad

Analogue trigger. Returns 0 to 1.

Unity (Old)
Input.GetAxis("Fire2")
Unity (New)
Gamepad.current.rightTrigger.ReadValue()
Unreal
EKeys::Gamepad_RightTrigger
Godot
Input.get_joy_axis(0, JOY_AXIS_TRIGGER_RIGHT)
Skeyboard

Backward in WASD layout.

Unity (Old)
Input.GetKey(KeyCode.S)
Unity (New)
Keyboard.current.sKey.isPressed
Unreal
EKeys::S
Godot
Input.is_key_pressed(KEY_S)
Scroll Downmouse

Weapon cycle or zoom out.

Unity (Old)
Input.GetAxis("Mouse ScrollWheel") < 0
Unity (New)
Mouse.current.scroll.ReadValue().y < 0
Unreal
EKeys::MouseScrollDown
Godot
Input.is_mouse_button_pressed(MOUSE_BUTTON_WHEEL_DOWN)
Scroll Upmouse

Weapon cycle or zoom in.

Unity (Old)
Input.GetAxis("Mouse ScrollWheel") > 0
Unity (New)
Mouse.current.scroll.ReadValue().y > 0
Unreal
EKeys::MouseScrollUp
Godot
Input.is_mouse_button_pressed(MOUSE_BUTTON_WHEEL_UP)
Select / Back / Viewgamepad

Select, back, or view button.

Unity (Old)
Input.GetButtonDown("Cancel")
Unity (New)
Gamepad.current.selectButton.wasPressedThisFrame
Unreal
EKeys::Gamepad_Special_Left
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_BACK)
Spacekeyboard

Common jump / confirm binding.

Unity (Old)
Input.GetKeyDown(KeyCode.Space)
Unity (New)
Keyboard.current.spaceKey.wasPressedThisFrame
Unreal
EKeys::SpaceBar
Godot
Input.is_key_pressed(KEY_SPACE)
Start / Menugamepad

Pause or menu button.

Unity (Old)
Input.GetButtonDown("Submit")
Unity (New)
Gamepad.current.startButton.wasPressedThisFrame
Unreal
EKeys::Gamepad_Special_Right
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_START)
Tabkeyboard

Scoreboard or inventory toggle.

Unity (Old)
Input.GetKeyDown(KeyCode.Tab)
Unity (New)
Keyboard.current.tabKey.wasPressedThisFrame
Unreal
EKeys::Tab
Godot
Input.is_key_pressed(KEY_TAB)
Up Arrowkeyboard

Directional input.

Unity (Old)
Input.GetKey(KeyCode.UpArrow)
Unity (New)
Keyboard.current.upArrowKey.isPressed
Unreal
EKeys::Up
Godot
Input.is_key_pressed(KEY_UP)
Wkeyboard

Forward in WASD layout.

Unity (Old)
Input.GetKey(KeyCode.W)
Unity (New)
Keyboard.current.wKey.isPressed
Unreal
EKeys::W
Godot
Input.is_key_pressed(KEY_W)
Xkeyboard

Cancel or holster.

Unity (Old)
Input.GetKeyDown(KeyCode.X)
Unity (New)
Keyboard.current.xKey.wasPressedThisFrame
Unreal
EKeys::X
Godot
Input.is_key_pressed(KEY_X)
X Button (Xbox) / Squaregamepad

West face button. Reload or interact.

Unity (Old)
Input.GetButtonDown("Fire3")
Unity (New)
Gamepad.current.buttonWest.wasPressedThisFrame
Unreal
EKeys::Gamepad_FaceButton_Left
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_X)
Y Button (Xbox) / Trianglegamepad

North face button. Switch weapon or special.

Unity (Old)
Input.GetButtonDown("Fire2")
Unity (New)
Gamepad.current.buttonNorth.wasPressedThisFrame
Unreal
EKeys::Gamepad_FaceButton_Top
Godot
Input.is_joy_button_pressed(0, JOY_BUTTON_Y)
Zkeyboard

Undo or prone.

Unity (Old)
Input.GetKeyDown(KeyCode.Z)
Unity (New)
Keyboard.current.zKey.wasPressedThisFrame
Unreal
EKeys::Z
Godot
Input.is_key_pressed(KEY_Z)

Frequently asked questions

Should I use Unity's old Input Manager or the new Input System?
Use the new Input System for any new project. It supports rebinding, multiple devices, action maps, and hot-swapping controllers cleanly. The old Input Manager is simpler for quick prototypes but lacks multi-device handling and is essentially in maintenance mode.
How do I detect a controller button press in Unity?
With the new Input System, define an action of type Button bound to <Gamepad>/buttonSouth (or whichever button), then read action.WasPressedThisFrame() in Update. With the old Input Manager, use Input.GetButtonDown with a button name configured in Project Settings > Input.
Why are my keycodes returning the wrong key?
KeyCodes map to physical keys regardless of layout, so KeyCode.A is always the leftmost letter on a QWERTY board even on AZERTY keyboards. For text-style input that respects the user's layout, use Input.inputString or the new Input System's Keyboard.current.onTextInput.
How do I know which controller a player is using in Unity?
With the new Input System, listen to InputUser.onChange or InputDevice.deviceAdded to detect device hotplug. The active control scheme on each PlayerInput tells you whether the player is on Keyboard&Mouse or Gamepad, which you can use to swap input prompts dynamically.

Last updated: