跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
设计与 UI

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 setupSetup
Creating actions and mapping contextsInput 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, chordBuilt-in Triggers
Dead zones, sensitivity, WASD→2D, invert YBuilt-in Modifiers
Adding/removing contexts, priority, split-screenMapping Contexts and Priority
Enabling/disabling contexts by gameplay stateInput Mode Filtering
Player key rebinding, settings screens, savingRuntime Key Rebinding
Input on actors with no PlayerControllerInput Without a PlayerController
Per-platform mapping context swapsPer-Platform Input Data
Writing a new trigger or modifierCustom Triggers, Custom Modifiers
Menus, cursors, CommonUIUI Input Mode
Debug overlaysDebugging

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:

PropertyDefaultMeaning
ValueTypeEInputActionValueType::BooleanBoolean, Axis1D (float), Axis2D (FVector2D), Axis3D (FVector)
AccumulationBehaviorTakeHighestAbsoluteValueOr Cumulative — all mappings sum, so W + S cancel
bConsumeInputtrueBlocks lower-priority Enhanced Input mappings on the same keys
bConsumesActionAndAxisMappingsfalseAlso blocks legacy Action/Axis mappings on those keys
bReserveAllMappingsfalseMappings are not overridden by higher-priority contexts
bTriggerWhenPausedfalseAction fires while the game is paused
Triggers / ModifiersemptyAction-level, applied after the per-mapping ones
PlayerMappableKeySettingsnullptrUPlayerMappableKeySettings — makes the action rebindable

UInputMappingContext : UDataAsset — key-to-action bindings, added and removed as a set.

MemberNotes
DefaultKeyMappingsFInputMappingContextMappingData; read the array with GetMappings()
MappingProfileOverridesTMap<FString, FInputMappingContextMappingData> — per key-profile overrides
RegistrationTrackingModeUntracked (default) or CountRegistrations
InputModeFilterOptionsUseProjectDefaultQuery (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

阅读完整来源 ↗