When two controllers connected, player2 input is disabled in client mode in PIE.
It worked correctly in 4.25, but it has been wrong since 4.26.
Digging into FSlateApplication::ProcessKeyDownEvent, The controller's input event OnKeyDown can be correctly routed to SPIEViewport in 4.25. In 4.26, Controller1's input is routed to SPIEViewport is correlctly, but Controller2's input is notified to SWindow, so the event cannot be triggered.
Workaround:
FReply FSceneViewport::AcquireFocusAndCapture(FIntPoint MousePosition, EFocusCause FocusCause) { // ... // Mouse down should focus viewport for user input // ReplyState.SetUserFocus(ViewportWidgetRef, FocusCause); ReplyState.SetUserFocus(ViewportWidgetRef, FocusCause, true); // ... }
Result:
The character doesn't move when input from controller 2.
The first controller input is allowed.
Expect:
Both controllers input is allowed.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-107689 in the post.
5 |
Component | UE - Editor - UI Systems |
---|---|
Affects Versions | 4.26, 5.1 |
Created | Feb 3, 2021 |
---|---|
Updated | Apr 10, 2023 |