Enhanced Input overview¶
Unreal's modern input stack. Replaces the old Project Settings → Input → Action Mappings table with content-side assets you can swap, layer, and modify at runtime.
For how Rephrased wires input on the player character, see Enhanced Input in Rephrased.
Three asset types¶
| Type | Prefix | Purpose |
|---|---|---|
UInputAction |
IA_ |
A semantic action: "Move", "Jump", "Interact". Has a value type (bool, float, Axis2D, etc.) but no key binding. |
UInputMappingContext |
IMC_ |
Maps physical keys/buttons to input actions. Multiple contexts can be active and layered. |
UInputModifier / UInputTrigger |
varies | Optional: deadzones, swizzles, hold/tap detectors. |
At BeginPlay¶
A pawn or character pushes its mapping context onto the local player's input subsystem. Conceptually:
if (APlayerController* PC = Cast<APlayerController>(GetController()))
{
if (ULocalPlayer* LP = PC->GetLocalPlayer())
{
if (UEnhancedInputLocalPlayerSubsystem* InputSub =
LP->GetSubsystem<UEnhancedInputLocalPlayerSubsystem>())
{
InputSub->AddMappingContext(DefaultMappingContext, 0);
}
}
}
After that, the engine routes physical input through the mapping context to the actions, and the action's bound function fires.
Binding actions to functions¶
In SetupPlayerInputComponent:
UEnhancedInputComponent* EIC = Cast<UEnhancedInputComponent>(PlayerInputComponent);
EIC->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::Move);
EIC->BindAction(InteractAction, ETriggerEvent::Triggered, this, &AMyCharacter::Interact);
Trigger events:
ETriggerEvent::Triggered— fires while the action is active (per-frame for axis, on press for buttons depending on triggers).ETriggerEvent::Started— first frame of a press.ETriggerEvent::Completed— release.ETriggerEvent::Canceled— interrupted before completion.
Use Triggered for movement axes, Started for one-shot button presses (jump, interact).
Why this is better than the old system¶
- Mapping contexts can be layered. The base context for gameplay sits underneath; a UI navigation context can stack on top without rewriting gameplay bindings.
- Modifiers and triggers compose. "Swap WASD on left-handed player" is a modifier on the existing context, not a new code path.
- Rebinding at runtime is straightforward — you mutate the active context, the engine picks it up.
Adding a new action¶
- Content browser → Input →
Input Action. Name itIA_Foo. Set the value type (Bool,Axis2D, etc.). - Open the default mapping context. Add a row, drop in
IA_Foo, assign keys/buttons. - In your character class, add a
UInputAction*field and a handler function (e.g.void DoFoo()). - In
SetupPlayerInputComponent, bind:EIC->BindAction(FooAction, ETriggerEvent::Started, this, &AMyCharacter::DoFoo); - In the Blueprint subclass, assign
FooAction = IA_Foo.
Gamepad support¶
Each IMC_* row can hold both a keyboard key and a gamepad input. The same IA_* is invoked regardless of source.
Change history¶
- 2026-05-23 — Gabriel Li — Fixed BeginPlay snippet (
APlayerControllercast beforeGetLocalPlayer). - 2026-05-08 — Gabriel Li — Added baseline change history section for weekly wiki maintenance.