Unity 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 | Notes | Unity (New) | |
|---|---|---|---|---|
| 1 | keyboard | Weapon or ability slot 1. | Keyboard.current.digit1Key.wasPressedThisFrame | |
| 2 | keyboard | Weapon or ability slot 2. | Keyboard.current.digit2Key.wasPressedThisFrame | |
| 3 | keyboard | Weapon or ability slot 3. | Keyboard.current.digit3Key.wasPressedThisFrame | |
| 4 | keyboard | Weapon or ability slot 4. | Keyboard.current.digit4Key.wasPressedThisFrame | |
| 5 | keyboard | Weapon or ability slot 5. | Keyboard.current.digit5Key.wasPressedThisFrame | |
| A | keyboard | Left in WASD layout. | Keyboard.current.aKey.isPressed | |
| A Button (Xbox) / Cross | gamepad | South face button. Jump or confirm. | Gamepad.current.buttonSouth.wasPressedThisFrame | |
| B Button (Xbox) / Circle | gamepad | East face button. Cancel or dodge. | Gamepad.current.buttonEast.wasPressedThisFrame | |
| Backspace | keyboard | Delete character in text input. | Keyboard.current.backspaceKey.wasPressedThisFrame | |
| C | keyboard | Crouch or toggle camera. | Keyboard.current.cKey.wasPressedThisFrame | |
| D | keyboard | Right in WASD layout. | Keyboard.current.dKey.isPressed | |
| D-Pad Down | gamepad | Old Input D-Pad requires manual axis setup in Project Settings > Input Manager. Use the New Input System for reliable D-Pad support. | Gamepad.current.dpad.down.wasPressedThisFrame | |
| D-Pad Left | gamepad | Old Input D-Pad requires manual axis setup in Project Settings > Input Manager. Use the New Input System for reliable D-Pad support. | Gamepad.current.dpad.left.wasPressedThisFrame | |
| D-Pad Right | gamepad | Old Input D-Pad requires manual axis setup in Project Settings > Input Manager. Use the New Input System for reliable D-Pad support. | Gamepad.current.dpad.right.wasPressedThisFrame | |
| D-Pad Up | gamepad | Old Input D-Pad requires manual axis setup in Project Settings > Input Manager. Use the New Input System for reliable D-Pad support. | Gamepad.current.dpad.up.wasPressedThisFrame | |
| Down Arrow | keyboard | Directional input. | Keyboard.current.downArrowKey.isPressed | |
| E | keyboard | Interact or lean right. | Keyboard.current.eKey.wasPressedThisFrame | |
| Enter / Return | keyboard | Submit or confirm action. | Keyboard.current.enterKey.wasPressedThisFrame | |
| Escape | keyboard | Pause menu or cancel. | Keyboard.current.escapeKey.wasPressedThisFrame | |
| F | keyboard | Flashlight, interact, or melee. | Keyboard.current.fKey.wasPressedThisFrame | |
| F1 | keyboard | Help or debug overlay. | Keyboard.current.f1Key.wasPressedThisFrame | |
| F2 | keyboard | Rename or secondary debug. | Keyboard.current.f2Key.wasPressedThisFrame | |
| F3 | keyboard | Debug info toggle. | Keyboard.current.f3Key.wasPressedThisFrame | |
| F4 | keyboard | Alt+F4 closes window on some platforms. | Keyboard.current.f4Key.wasPressedThisFrame | |
| F5 | keyboard | Quick-save in many games. | Keyboard.current.f5Key.wasPressedThisFrame | |
| Left Alt | keyboard | Walk or modifier key. | Keyboard.current.leftAltKey.isPressed | |
| Left Arrow | keyboard | Directional input. | Keyboard.current.leftArrowKey.isPressed | |
| Left Bumper (LB / L1) | gamepad | Left shoulder button. | Gamepad.current.leftShoulder.wasPressedThisFrame | |
| Left Ctrl | keyboard | Crouch or modifier key. | Keyboard.current.leftCtrlKey.isPressed | |
| Left Shift | keyboard | Sprint or crouch modifier. | Keyboard.current.leftShiftKey.isPressed | |
| Left Stick Press (L3) | gamepad | Click the left thumbstick. Sprint toggle. | Gamepad.current.leftStickButton.wasPressedThisFrame | |
| Left Stick X Axis | gamepad | Horizontal movement. Returns -1 to 1. | Gamepad.current.leftStick.ReadValue().x | |
| Left Stick Y Axis | gamepad | Vertical movement. Returns -1 to 1. | Gamepad.current.leftStick.ReadValue().y | |
| Left Trigger (LT / L2) | gamepad | Analogue trigger. Returns 0 to 1. | Gamepad.current.leftTrigger.ReadValue() | |
| Mouse Delta | mouse | Camera look. Raw pixel movement per frame. | Mouse.current.delta.ReadValue() | |
| Mouse Left Click | mouse | Primary fire or select. | Mouse.current.leftButton.wasPressedThisFrame | |
| Mouse Middle Click | mouse | Ping or third action. | Mouse.current.middleButton.wasPressedThisFrame | |
| Mouse Right Click | mouse | Aim down sights or secondary action. | Mouse.current.rightButton.wasPressedThisFrame | |
| Q | keyboard | Ability or lean left. | Keyboard.current.qKey.wasPressedThisFrame | |
| R | keyboard | Reload in shooters. | Keyboard.current.rKey.wasPressedThisFrame | |
| Right Arrow | keyboard | Directional input. | Keyboard.current.rightArrowKey.isPressed | |
| Right Bumper (RB / R1) | gamepad | Right shoulder button. | Gamepad.current.rightShoulder.wasPressedThisFrame | |
| Right Stick Press (R3) | gamepad | Click the right thumbstick. Melee or zoom. | Gamepad.current.rightStickButton.wasPressedThisFrame | |
| Right Stick X Axis | gamepad | Camera horizontal. Returns -1 to 1. | Gamepad.current.rightStick.ReadValue().x | |
| Right Stick Y Axis | gamepad | Camera vertical. Returns -1 to 1. | Gamepad.current.rightStick.ReadValue().y | |
| Right Trigger (RT / R2) | gamepad | Analogue trigger. Returns 0 to 1. | Gamepad.current.rightTrigger.ReadValue() | |
| S | keyboard | Backward in WASD layout. | Keyboard.current.sKey.isPressed | |
| Scroll Down | mouse | Weapon cycle or zoom out. | Mouse.current.scroll.ReadValue().y < 0 | |
| Scroll Up | mouse | Weapon cycle or zoom in. | Mouse.current.scroll.ReadValue().y > 0 | |
| Select / Back / View | gamepad | Select, back, or view button. | Gamepad.current.selectButton.wasPressedThisFrame | |
| Space | keyboard | Common jump / confirm binding. | Keyboard.current.spaceKey.wasPressedThisFrame | |
| Start / Menu | gamepad | Pause or menu button. | Gamepad.current.startButton.wasPressedThisFrame | |
| Tab | keyboard | Scoreboard or inventory toggle. | Keyboard.current.tabKey.wasPressedThisFrame | |
| Up Arrow | keyboard | Directional input. | Keyboard.current.upArrowKey.isPressed | |
| W | keyboard | Forward in WASD layout. | Keyboard.current.wKey.isPressed | |
| X | keyboard | Cancel or holster. | Keyboard.current.xKey.wasPressedThisFrame | |
| X Button (Xbox) / Square | gamepad | West face button. Reload or interact. | Gamepad.current.buttonWest.wasPressedThisFrame | |
| Y Button (Xbox) / Triangle | gamepad | North face button. Switch weapon or special. | Gamepad.current.buttonNorth.wasPressedThisFrame | |
| Z | keyboard | Undo or prone. | Keyboard.current.zKey.wasPressedThisFrame |
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.
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: