I am working on a VR project and I use the widget interaction component to interact with widgets in the world. As I am trying to fill en editable text box inside a widget and pass characters from another widget which simulates the keyboard I am loosing focus on the editable text box. For the Keyboard widget I set window focusable to false. However when I accidently hover an other widget in the scene (there can be a few who needs focus and people can be unpredictable) then I loose focus.
I don’t see any function I can call from the widget interaction component to set it’s focus to the previous editable text box, is it even possible? I would prefer a solution in blueprints if it exists. I know there is the set user focus called with a player controller but it doesn’e seem to work accordingly with the widget interaction component.
Also when I try to know which widget inside the login widget has the focus of any user, none of them have it even though the login has one focused descendant… in the photo attached the focus is set on “email” but it says it is set to false, This all function is called OnWidgetHoveredChanged from the widget interaction component
There’s a SetFocus function for the widget interaction component. The SetUserFocus function shown above only affects the hardware input focus, but not the virtual input focus used by the widget interaction component. Also, try setting the input mode to FInputModeGameOnly and make sure the keyboard widget is not window focusable. You can also try setting window focusable to false for all the widget components when you need the text box to keep focus, and then return the window focusable setting to true once the text has been committed.
Also, once the text has been committed, it might take an extra click before the widget component starts reacting to further inputs. This is pretty annoying. I get around this by toggling on an invisible border that covers the entire widget, and then in the tick function, I detect if the border is underneath the cursor and send a click with the widget interaction component.