I’m trying to find a way to have a bunch of widgets (mostly buttons) on the screen that the user can use the arrow keys to select and the enter key to press, while simultaneously being able to interact with the 3D scene through mouse clicks and other keys.
I have the input mode set to Game and UI, and when I click in the 3D scene (not on a widget) the widgets lose keyboard focus and you have to click on them again before you can use the arrow keys. Is there any way I can force the UI to always have keyboard focus?
This may sounds weird but set the controller for Game only instead. Setting it for UI seems to enable the mouse to input into the UI space. which is removing the focus and setting it to the clicked area on the viewport instead. It can also locks the character from operation he camera normally without left clicking. As the controller is trying to decide the inputs between the UI and game space.
I needed to add an OnNativeTick method in parent widget that checks for focused widget. If none is focused reset focus to defined default widget (e.g. first button in menu). You can also do it in BP.