[4.6.1/4.7 P5] Click in UMG component no focus the game

If in the editor you click to play the game and for example the game have a menu, when you put the mouse over the buttons of the game:
1º- Interact with the mouse.
2º- If click in the buttons interact and create a click but the mouse/keyboard don’t focus in the game to play.

Video Example: https://dl.dropboxusercontent.com/u/28070491/UE/Forums/2015-02-10-1653-34.flv

Hello Hevedy,

If you would like set focus to the keyboard you could try using the set keyboard focus node. I hope this helps.

Here is an example.

Make it a great day

Ok thanks, but is a main problem with the mouse and the click with the buttons.

Hello Hevedy,

I am uncertain as to the exact issue you are experiencing. Do you need help setting focus between Game and UI?

If so you could use the “Set Input Mode Game Only” node and the “Set Input Mode Game And UI” node

Here is an example:

No, the problem is the focus but between the OS/Editor and the Game/Viewport.
For example, if you have a normal game in a window mode (in this case viewport) when you click in the buttons of game menu, automatically the game focus your keyboard & mouse and are locked to the game window.
If you see my video in the post, when i put the mouse over or click in the buttons the mouse don’t is locked to the viewport and give the effect of normal button from normal program. That is.

  • Anyway thanks for the other examples.

Hello Hevedy,

If you would like to lock the mouse to the viewport, you could use the “Set Input Mode Game and UI” node. There is a check box (as seen in the above example) that you can check that will lock the mouse to the screen.

Make it a great day

That give 2 problems:
1º- I got the mouse set to no visible and now is visible and the Hide cursor & show mouse cursor are unchecked.
2º- Now is locked but if you press the windows button navigate in the computer and then press in a BUTTON from the game viewport now is bug is back, but if press in the background (NO BUTTONS) then is locked.

Hello Hevedy,

Could you explain exactly what it is that you are trying to achieve? If you could give a more detailed explanation of exactly what it is you are trying to do I may be able to assist you more easily.

As for the button causing the screen to unlock, you could do something like the following. Keep in mind this is only an example and you may need to use “Set Input Mode Game only” or “Set Input Mode UI only”. If you place these at the end of your button click events it will insure that your mouse is always locked to the screen.

29860-lockscreenhelp.png

I’m tested that in other games, probably me bad sorry. But thanks for all, this solve some of my problems thanks.
Never mind the focus problem… solved.