Download

VR UMG Interface set focus issue

UE4.13

To save the game, I spawn an actor that consists of multiple UMG WidgetComponents. I have a TextBox placed in one widget, a virtual keyboard placed in another widget.
The keyboard uses WidgetInteractionComponent (WIC) to send (Send Char node) to unreal.
Without changing anything about the input, I can select the textbox and press on the keyboad buttons -> Works.

After spawn of the actor, I want to set focus to the TextBox, to make input from the keyboard go into that box without selecting it first. But can´t manage to do this without breaking the whole input. Everywhere on the forum they tell you to use “Set Input Mode Game and UI”. This does not work, cause when executing that node, it seems Windows (OS) is loosing input focus to the game. (After Node execution the mouse breaks free and is moveable across the whole monitor (game is only a small window) and the WIC does not receive the input from the Vive controllers any more. Using SetKeyboardFocus does not work either, cause it breaks input from the WIC. SetUserFocus turns out the same. SetInputModeGameOnly prevents interaction with UMG as it should.

What focus is set when clicking into the TextBox with WIC?

How to set the focus to the TextBox automatically but be able to press buttons on different widgets?

We have this question too, did you ever find a solution?

Apparently in UE 4.15 this is fixed, but I solved it in UE4.14 by writing my own WidgetInteractionComponent that sends input events with a PlayerController user ID set to 0 (instead of a virtual player controller’s ID). I can then focus and navigate on widgets after calling both SetUserFocus and SetKeyboardFocus.
Note: in some cases, the default widget navigation led to crashes in shipping builds for me, so I had to catch the navigation events and recreate navigation by hand using OnPreviewKeyDown.