Send a key through the local Unreal controller in a headless input fixture
Section titled “Send a key through the local Unreal controller in a headless input fixture”- Status: current
- Engine: ue6-main
61e2877e10, Linux x86_64, Epic clang 23.1.5 - Context: standalone UE6 Development game with Enhanced Input
- Prerequisites: a local player controller, a bound action and a mapping from the gamepad key to that action
Symptom
Section titled “Symptom”Calling the deprecated FInputKeyParams(Key, IE_Pressed, 1.0f, true) raises error: call to constructor of 'FInputKeyParams' is ambiguous. Using IPlatformInputDeviceMapper::Get() without a direct module dependency can produce ld.lld: error: undefined symbol: IPlatformInputDeviceMapper::Get().
Smallest example / reproduction
Section titled “Smallest example / reproduction”A Development-only console command sends EKeys::Gamepad_FaceButton_Bottom to the local controller. Run it twice with different frames between press and release. Bind the key to an Enhanced Input action with a handler on ETriggerEvent::Started.
Solution
Section titled “Solution”Add ApplicationCore as a private module dependency. Include InputKeyEventArgs.h and GenericPlatform/GenericPlatformInputDeviceMapper.h. Call the local controller’s InputKey overload that takes FInputKeyEventArgs, using IPlatformInputDeviceMapper::Get().GetDefaultInputDevice(), the gamepad key, IE_Pressed and FPlatformTime::Cycles64(). Send IE_Released with an amount of zero on a short one-shot world timer. The Coop Zero fixture uses 60 ms and waits at least 150 ms between commands.
Why it works
Section titled “Why it works”The controller delivers both key transitions to its player input and lets Enhanced Input evaluate the real key mapping and action bindings. A release on a distinct tick allows the next press to start the action again. The direct module dependency resolves the mapper symbol in the modular editor target.
Verified
Section titled “Verified”- Evidence level: compiled, runs in packaged build
- How:
bash Saved/step11-lane.sh editor -logcaseloggedResult: Succeeded.bash Scripts/prove_ui.shsentcoop.uipress a,coop.uipress rightandcoop.uipress athrough the local controller.Saved/step11-proof.ypOYAl/sequence.logloggedWELCOME,FARMER_PICK color=mint,FARMER_PICK color=berry,FARMER_PAWN_COLOR rgb=224,121,163andPLAY color=berryin order. The same fixture sent B to drop a partially used scoop and reportedStep 11 packaged assertions passed. - Date / by: 2026-11-25, Coop Zero Step 11
Limits and assumptions
Section titled “Limits and assumptions”The fixture enters at the local controller. Platform input translation, physical controller navigation and device discovery require separate testing. Use the device owned by the local player when the project filters events by platform user.