ue-input-system
Use when wiring player input in Unreal C++ with Enhanced Input — input actions, mapping contexts, triggers, modifiers, binding handlers and runtime key rebinding. Also use when the user mentions 'Enhanced Input', 'UInputAction', 'UInputMappingContext', 'AddMappingContext', 'BindAction', 'SetupPlayerInputComponent', 'ETriggerEvent', 'input trigger', 'input modifier', 'SwizzleAxis', 'dead zone', 'WASD', 'gamepad', 'key rebinding', 'UEnhancedInputUserSettings' or 'input mapping priority'. For UI input modes and CommonUI routing, see ue-ui-umg-slate; for PlayerController/Pawn possession, see ue-gameplay-framework.
quodsoler · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add quodsoler/unreal-engine-skills --skill ue-input-system技能说明
name: ue-input-system description: "Use when wiring player input in Unreal C++ with Enhanced Input — input actions, mapping contexts, triggers, modifiers, binding handlers and runtime key rebinding. Also use when the user mentions 'Enhanced Input', 'UInputAction', 'UInputMappingContext', 'AddMappingContext', 'BindAction', 'SetupPlayerInputComponent', 'ETriggerEvent', 'input trigger', 'input modifier', 'SwizzleAxis', 'dead zone', 'WASD', 'gamepad', 'key rebinding', 'UEnhancedInputUserSettings' or 'input mapping priority'. For UI input modes and CommonUI routing, see ue-ui-umg-slate; for PlayerController/Pawn possession, see ue-gameplay-framework." metadata: version: "2.0.0" engine: "5.8"
UE Input System
Target engine: UE 5.8. APIs below are verified against the 5.8 headers; older forms are listed under "Deprecated — do not use".
Enhanced Input is the engine's only supported input path. It lives in the EnhancedInput plugin (Engine/Plugins/EnhancedInput, enabled by default in 5.8); add "EnhancedInput" to PublicDependencyModuleNames in your Build.cs, plus "InputCore" if you touch FKey/EKeys directly and "GameplayTags" if you use input-mode filtering or the user-settings failure-reason containers. The runtime pieces are UEnhancedPlayerInput, UEnhancedInputComponent, UEnhancedInputLocalPlayerSubsystem, the data assets UInputAction / UInputMappingContext, and UEnhancedInputUserSettings for player rebinding.
Context
Read .agents/ue-project-context.md if it exists (module names, conventions, enabled plugins, GAS/networking setup). Do not stop if it is missing.
Identify the area from the request and the codebase. Ask only when two plausible readings would produce different code.
| Request is about… | Go to |
|---|---|
| Plugin, module, ini setup | Setup |
| Creating actions and mapping contexts | Input Assets |
| Binding handlers in C++ | Binding Actions in C++ |
Which event to bind (Started vs Triggered vs Completed) | Trigger Events |
| Hold, tap, double-tap, pulse, chord | Built-in Triggers |
| Dead zones, sensitivity, WASD→2D, invert Y | Built-in Modifiers |
| Adding/removing contexts, priority, split-screen | Mapping Contexts and Priority |
| Enabling/disabling contexts by gameplay state | Input Mode Filtering |
| Player key rebinding, settings screens, saving | Runtime Key Rebinding |
| Input on actors with no PlayerController | Input Without a PlayerController |
| Per-platform mapping context swaps | Per-Platform Input Data |
| Writing a new trigger or modifier | Custom Triggers, Custom Modifiers |
| Menus, cursors, CommonUI | UI Input Mode |
| Debug overlays | Debugging |
Full per-class parameter tables live in references/input-action-reference.md.
Setup
// Build.cs
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" });
DefaultInput.ini — point the engine's default classes at Enhanced Input:
[/Script/Engine.InputSettings]
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent
Enhanced Input project settings live on UEnhancedInputDeveloperSettings (Project Settings → Engine → Enhanced Input), written to DefaultInput.ini under [/Script/EnhancedInput.EnhancedInputDeveloperSettings]. Keys that change C++ behaviour: bEnableUserSettings, UserSettingsClass, DefaultPlayerMappableKeyProfileClass, InputSettingsSaveSlotName, bEnableWorldSubsystem, DefaultWorldInputClass, bEnableInputModeFiltering, DefaultMappingContextInputModeQuery, DefaultInputMode, bEnableDefaultMappingContexts, bSendTriggeredEventsWhenInputIsFlushed.
Input Assets
UInputAction : UDataAsset — one per logical player action. Properties that change C++ behaviour:
| Property | Default | Meaning |
|---|---|---|
ValueType | EInputActionValueType::Boolean | Boolean, Axis1D (float), Axis2D (FVector2D), Axis3D (FVector) |
AccumulationBehavior | TakeHighestAbsoluteValue | Or Cumulative — all mappings sum, so W + S cancel |
bConsumeInput | true | Blocks lower-priority Enhanced Input mappings on the same keys |
bConsumesActionAndAxisMappings | false | Also blocks legacy Action/Axis mappings on those keys |
bReserveAllMappings | false | Mappings are not overridden by higher-priority contexts |
bTriggerWhenPaused | false | Action fires while the game is paused |
Triggers / Modifiers | empty | Action-level, applied after the per-mapping ones |
PlayerMappableKeySettings | nullptr | UPlayerMappableKeySettings — makes the action rebindable |
UInputMappingContext : UDataAsset — key-to-action bindings, added and removed as a set.
| Member | Notes |
|---|---|
DefaultKeyMappings | FInputMappingContextMappingData; read the array with GetMappings() |
MappingProfileOverrides | TMap<FString, FInputMappingContextMappingData> — per key-profile overrides |
RegistrationTrackingMode | Untracked (default) or CountRegistrations |
InputModeFilterOptions | UseProjectDefaultQuery (default), UseCustomQuery, DoNotFilter |
MapKey(Action, Key) / UnmapKey(Action, Key) | Editor/config-screen helpers, not a runtime rebinding API |
HasMappingForInputAction(Action) | Search default and profile-override mappings |
Each FEnhancedActionKeyMapping carries Action, Key, per-mapping Triggers, Modifiers, a SettingBehavior (EPlayerMappableKeySettingBehaviors: InheritSettingsFromAction, `OverrideSettin