In UE4.15 I am unable to separate Keyboard from Gamepad 1 within UMG elements.
Example:
[Setup] Initialize all available Player Controllers, with the minimum being: Keyboard = Player Controller 0 (PC0), Gamepad1 = Player Controller 1 (PC1).
[Scenario A]: Create and add a widget with at least one focus-able object to viewport. Use “Set User Focus” blueprint element, targeted at the focus-able object and PC0 (Keyboard). Observe that navigation can be performed with PC0 as well as PC1 (Gamepad1), despite Gamepad 1 being its own Player Controller.
[Scenario B]: Create and add a widget with at least one focus-able object to viewport. Use “Set User Focus” blueprint element, targeted at the focus-able object and PC1 (Gamepad1). Observe that navigation cannot be performed with PC1. Note however that if another controller had been plugged-in and initialized, as PC2, it would be able to navigate.
This has been infinitely frustrating for me to work around, as everything else within my project works. I am able to initialize all player controllers and load a join-in screen for local multiplayer. As long as I handle all UMG input from my Player Controller Blueprint it’s fine, but as soon as I attempt to use the built-in UMG focus system it lumps Keyboard+Gamepad1 as a single player.
After completing join-in my players are able to enter game without issue. Keyboard being completely separate from Gamepad1.
I know that this is a pretty old question, but I’m curious what you did to resolve the issue. I’m having the same problem in 4.18.3 and it’s a serious issue to the project’s development.
I still have the same issue in 4.26.2.
I really hope this will be fixed soon. Otherwise I see no way of creating two player multiplayer with one person on keyboard&mouse and an other person on the controller, when there is only one controller.
This problem already took a lot of time as i tried to work around it. But without any luck so far … very frustrating -.-
My only solution for now is to keep the “Skip Assigning Gamepad to Player 1” unchecked.
Thank you very much! Looks very promising (aside from the formatting being broken)
But the InputKey(...) function seems to be deprecated and cannot be overridden because it is declared as final.
I tried to override the new InputKey(const FInputKeyEventArgs& EventArgs) function, but I’m unable to change EventArgs.ControllerId
bool UMyGameViewportClient::InputKey(const FInputKeyEventArgs& args) {
if (args.IsGamepad()) {
FInputKeyEventArgs newArgs = FInputKeyEventArgs(args.Viewport, args.ControllerId + 1, args.Key, args.Event);
return Super::InputKey(newArgs);
}
else {
return Super::InputKey(args);
}
}
I think i got the script working. But sadly, the widget control problem is not fixed with this …
Behaviour/bug seems to be exactly the same as with the “Skip Assigning Gamepad to Player 1” setting.