I’ve been using widget interaction to interact with world widgets in my project, but after updating unreal engine 5.1 it works a little differently.
As you can see in the video, after interacting with a button once, it no longer responds to the interaction until I interact with another widget. It seems like some sort of focusing (Although “is Focusable” is off for the button). I didn’t have this problem in unreal engine 4.27 and 5.0. Is there some new change to buttons or Widget interaction that I’m not aware of?
Thanks, it solves the important part of the issue. Unfortunately though, just like setting the input mode to FInputModeGameOnly, after the first interaction the button style stays as “Pressed”, But that’s okay for my project.
[UE 5.1.0] For anyone else having the same problem, make sure that:
You’re using “onPressed” (not “onClicked”) event for your buttons
After sending interaction to the widget, use either of these methods depending on your project:
a. [Thanks to StormX31211] FSlateApplication::Get().SetAllUserFocusToGameViewport();
b. YourController->SetInputMode(FInputModeGameOnly());
Set onPressed style of your button same as the normal style
I have the same problem, but unfortunately the suggested workarounds do not fully solve the problem:
After setting the focus to the game viewport everything works fine except clicking inside EditableTextBoxes. The cursor is placed, but focus is then lost and I can’t enter any text.
Don’t Set focus to the game viewport when the player interacts with the widget, let the player enter the text then use the “OnTextCommitted” event to call “SetInputModeGameOnly” on the player controller (After entering text, you should commit it (By pressing Enter key, or any other way)).
I don’t think this is an option for me, as I have a UI with multiple text boxes and the user should be able to just select the next text box with the WidgetInteraction.
The focus problem was fixed for me by switching to the new EnhancedInput system. It also did only work after creating and setting the ‘Mappable Input Config for XR’.
I’m still having an issue with SendKeyChar() not working this way, so this is not a full solution.
@andreyrd1 It’s in the project settings under ‘Plugins - OpenXR input’ if you have the OpenXR plugin active. The setting is probably only relevant if you are developing for VR / XR.
Reverting the commit fixes the problem for my use case and fully restores the old behavior, but I’m not sure about other scenarios and what the commit was trying to fix in the first place.
This obviously only works, if you’re using a source build of Unreal Engine.
@VictorLerp I’m not sure who should be looped in on this, but in my searching as I’ve dealt with it I’ve found a fair amount of comments regarding this issue, and it seems like undesired or undocumented behavior change. If you know who would know more, or if you know more about this bug (?), can you follow up? *tagging you since you’ve worked with OpenXR and VR implementation previously… thank you.
I don’t know if my problem is exactly the same as described here.
Context:
I work on OpenXR app, recently upgraded from Unreal Engine 4.27 to 5.1 that use the “old” input system, I have started my project from UE 4.27 OpenXR Template.
I maked a World UI with two buttons and want to interact with it with my controllers.
The issue I experiment:
When I call “Release Pointer key” on Widget Interaction Right/Left, my Unreal Window is unfocused, so I can’t interact with my app anymore with my controllers unless I maked Alt+Tab and manually re-focus my windows with my mouse.
My solution:
call function “set Focus To Game Viewport” after I call “release pointer key”