When focus changes an IE_Released event occurs for the W key (your character stops moving) due to UGameViewportClient::LostFocus calling APlayerController::FlushPressedKeys. Because of the R key press windows stops sending repeat WM_KEYDOWN messages for W and won't send any further messages until it is released.
We probably shouldn't be calling FlushPressedKeys here, but instead handling window resizing (and whatever else was cause the original bug that led to it being added) better. Need to investigate.
Note: Workaround is to override your player controller's FlushPressKeys and only call Super::FlushPressedKeys() if you didn't just switch the focus, but this may have knock ons if one of the events responsible for the UGameViewportClient::LostFocus bug occurs on the same frame.
See UDN for sample + extra repro details/bug explanation: https://udn.unrealengine.com/s/question/0D54z0000775mqsCAA/handling-character-movement-while-interacting-with-ui-in-gameandui-mode
Or from scratch in ThirdPersonExampleMap:
Map R key to an input action which:
Creates and adds a widget (just a button, doesn't really matter).
Delays 2s
Call "Set User Focus" on the widget
PIE, press W to start moving forward, press R, continue holding W.
After 2 seconds your character stops moving forwards, and will not move forwards again until you release and repress W.
How does TextureRenderTarget2D get TArray<uint8> type data?
How do I set a material as a post-processing material?
Why does the REMOVE method of map container remove elements have memory leaks?
How to delete some elements correctly when deleting an array loop?
UMG RichText not appear image when packaged
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
What is the difference between Camera and CineCamera?
How to assign a value to a member of UMG's UMaterialInterface pointer type in C++?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-125224 in the post.
0 |
Component | UE - Gameplay - Input |
---|---|
Affects Versions | 4.26, 4.27, 5.0 |
Target Fix | 5.1 |
Created | Sep 3, 2021 |
---|---|
Resolved | Jul 20, 2022 |
Updated | Aug 30, 2022 |