a couple functions cover this that you can test around with. one is ‘set focus to game viewport’. the others are ‘set input mode game only’, ‘set input mode ui only’, and ‘set input mode game and ui’. these can be called from your player controller.
Please if anyone can help I have been through a slew of Answerhub items about this and can’t figure it out. I have an inventory screen in UMG which I want to have work with a mouse cursor and/or gamepad. Once I click on one of the buttons it automatically allows gamepad interactivity, but not before. I have messed around with setfocus and while this helps the widget appear active to the mouse for mouseovers and the like, it does nothing for the gamepad. Once I mouse click a button on the inventory screen, even one that does nothing, magically full interaction with the gamepad is available. Any ideas how I can get this interactivity at the start?
I made a manual workaround and discovered there is the built-in gamepad interaction quite by mistake. Its in there, I just cant activate it without having to first mouse click a button. Thanks.
Many thanks Paradoc!
For others doing this the trick for me was:
- Use Set Input Mode Game and UI
- Get Player Controller as Target
- In Widget to Focus (MUST be set to a widget that can have focus like a button, not the hud itself)
- I still need to figure out how to make the item appear to have focus. The dotted line around the objects dont appear until I move the left thumb stick on the gamepad.
It works even with a game pause, which I am toggling without a problem, however I did learn that if you use a gamepad input to toggle the UMG screen make sure you select the “execute when paused” to true in the details panel of the input event.