Setting keyboard focus for a single screen in local splitscreen.

I currently have a splitscreen game setup in which one player is on mouse/keyboard and the other is on controller. I want to make a widget that allows an interacting player to navigate through a menu with either the mouse or the controller while allowing the other player to continue controlling the game as normal. Is there a way to do this in blueprints? When I use set keyboard focus, both players lose control of the game.

1 Like

Hello @Killerbanaple how are you?

In order to provide you with a proper answer, could you share your setup for split screen and controllers assignment, as well as your current widgets?

That way I will be able to reproduce your isuee and solve it based on your setup!

I’ll be waiting for your answer!

1 Like

This isn’t possible with a single global keyboard focus. In local splitscreen, keyboard and mouse input are shared, so setting keyboard focus affects all local players. The correct approach is to use separate input modes per PlayerController. Set the interacting player to UI Only or Game and UI and route widget input through that PlayerController, while keeping the other PlayerController in Game Only. For controllers, enable focus navigation per widget and avoid Set Keyboard Focus; instead, create and add the widget from the specific PlayerController that should control it.

1 Like

Hello @Killerbanaple it’s me again!

I’ve been tinkering a lot with this idea and I came to the conclussion that the best approach for this is to implement Common UI to handle it. It will alow you to identify the controllers properly without hindering the other player’s movement.

Without using it, I wasn’t able to make the menu work properly, so I highly recomend you to watch this full tutorial on how to implement common UI and use it for your game!

Hope this helps you! Let me know if you have any doubts!

1 Like

Thank you so much! I’ll have to take a look at these next time I am at my computer!

I just got around to watching this and although they show how to assign keys to various functions which seems very promising, it does not actually demonstrate using any of these assigned keys. I did learn a lot about common UI applications but I can not figure out how to apply them to this issue. Was I missing something?

I have tried using set user focus with the corresponding local player controller assigned, but regardless of who is assigned to a given set user focus node, it still seems to take all players focus. The same seems to apply when using set UI only or game and UI only.

When I do this, for example, focus is set to the widget correctly on top screen and both players remain in game since the input mode has not been adjusted, however, both players still control the topscreen widget. If the bottom screen widget is opened, neither player gets focus over it.

If I instead do this, the same issue occurs where both players focus the top screen, but now neither player has control over the game, despite the player controller variable being plugged in here.

What am I missing here?

Its been pretty good! And not that Ive had a minute to look around, this is the extent of my controller setup I think.