Simulate key input in UMG

I’m working on a pause menu that can be opened or closed by pressing “P” (later to be changed to Esc).
Within the pause menu there’s also a “resume game” button that supposedly should have the same effect as pressing “P” again to take you back into the game.
However, I cannot get the cursor to disappear and the camera controls to become active again after clicking this button, unlike when I simply press “P” on my keyboard. No matter what I try I always have to press “P” again to give the controls back.

Does anyone know if there’s a way I can simply simulate the key press of “P” when I click the resume button? It would be a lot easier and perhaps even more solid as well, I can imagine.

This is a good topic. I have the same question. I am using esc button for pause menu (with FlipFlop) and would like to assign Esc key to Resume button (I have it too). And I have the same problem with cursor not dissapearing and also when I press Resume after that I must press Esc two times to activate pause menu (it is because FlipFlop, it registeres one press of Esc, when you press Resume it does not count as Esc key; of course if I press Esc again while in pause menu it worls as it shoul). It would be great to know how can we assign InputAction in UMG to the button so it would register as an InputAction (Esc key in my case) while we press a button.
So the basic question is: how to assign InputAction to OnClicked (Button press) event in UMG?
I am also using UE 4.8.3

Is there no one who knows how to fix this?

Hello Mr Robville,

After reading over your issue I have a suggestion that may be viable. You will need to use the “Set Input Mode Game Only” in combination with the “Set show Mouse cursor” node when clicking the resume button. This will set the input back to game mode and hide the cursor (if you set the “Set Show mouse cursor” to false). There are two other nodes you should be aware of that will help you circumvent similar issues in the future. Those are “Set input mode UI only” and “Set Input mode Game and UI”. I hope that this information helps.

Make it a great day

Hi, have you ever found an answer to your question? Is input key bindable to UMG?

Hello!
No, I have not found a way how to bind input key in UMG.
It would be great if someone could tell if there is a way to do this and how to do this.

Hello Selphadur,

You could override the OnKeyDown function within UMG. From there you could get the key that is being pressed and test to see if it is the key that you would like to use when performing the intended action. From there you would script the action that is desired. I hope that this information helps.

Make it a great day