Play event after key sequence
I tried to figure this out for about half a day now without getting any closer to a solution, so I ask you guys now.
This is the situation: I want to create an exit menu, which allows you to leave the game/close it. But it shall only work by keyboard input. So I got the idea to create a widget which shows the text "press enter to leave" in the game screen and let it open up by pressing esc. Works fine so far. But now I need to tell the game that if I press enter now, it shall close the game. But the enter button only is supposed to close the game, if I pressed esc before and opened my warning/widget asking if I really want to leave.
So how do I tell the enter key to only close the game if I had pressed escape before?
Thanks a lot!
asked Aug 27 '15 at 01:13 PM in Blueprint Scripting
Then I would do the following setup for as an example,
1) Setup and Input Key for your PlayerController blueprint for the "Escape" key.
2) When the Escape Key is pressed, turn on your warning/confirmation button, make sure to "SetFocus" to the widget, and Set Input Mode to UI Only.
3) In your widget, check for the KeyDown event for the "Enter" key.
From there exit the game.
UMG and button mapping is still something the devs want to improve on but for now thats a way to do it. Hope that helps =)
Follow this question
Once you sign in you will be able to subscribe for any updates here