i had made a pause menu widget screen, with a few options for the player, right now the game is pausing when the player hits “escape” and the player can return/resume game pressing a button “Resume Game”.
i want to add the common practice, to use the same “Escape” key to exit the pause screen, i tried many things from the forums and from google to make it to work, but without any good result.
anyone knows how to get input from key, when the widget is active and the input mode is in UI mode only?
The easy way to handle this is to use Set Input Mode Game and UI, and have only the Escape button event execute when paused. If other input events don’t execute when paused, this should get the job done.
But if that’s out of the question and you prefer using Set Input Mode UI Only, then you’ll have to handle the keyboard input from the Widget itself. First select your Pause menu widget and set its Is Focusable attribute to True.
Next we need to make sure that the widget has the keyboard focus. This can be achieved by calling the Set Keyboard Focus function in the Event Construct of the widget.
Finally, we’ll have to override the On Key Down event and add the logic for removing the pause menu if the required key is pressed.