UE 4.21 - ButtonStart loses focus when click on canvas

When you click anywhere except the button before tap the Return key, the button start lose focus of the keyboard and the return key for load the next doesn’t work. After a few search, I fix it with this solution : https://answers.unrealengine.com/questions/443634/bug-losing-focus-when-clicking-in-level-view.html

In resume, you set the canvas as a variable and make it “Visible” in the “Behaviour”. Then in the graph, you overload the function “OnMouseButtonDown” and make it similar than explain in the topic. I do this :

In pseudo code, it’s : check if we hover the canvas, it true, put back the focus on the keyboard when you click (This is why we overload the on mouse button down function). I try a solution when you check if the button has already the focus but with debugging, there a weird bug (even if the button has the focus… Well… Don’t work anyway xD) So I always put back the focus on the keyboard no matter what.

Privacy & Terms