Escape to open menu unfocuses immediately

I’m trying to have my game’s pause menu open and close with the Escape key. The former is easy, but the latter is somewhat annoying to implement. Apparently, the same key event that opens the menu immediately also causes it to lose focus, so pressing Escape again won’t close it unless you click one of the buttons first. This doesn’t happen with another menu that’s opened by the E key–that one opens and closes with keypresses just fine. It must be the default functionality of Escape in particular. Is there any way to disable or work around this? I tried simply calling “set keyboard focus” every tick, but that didn’t help.

Check the Root of your umg hirarchy, Properties, interaction->isfocusable? Maybe this helps if it is checked. When showing your pause menue setting the user input to UI-Only does help you eventually, too

I have it on UI Only but I’ll check and see about isfocusable.

Apparently Is Focusable was unchecked in the blueprint options while it was checked in the other menu. It was nothing to do with the Escape key in particular. That said I’ve never messed with that option so I don’t know why it’s different. Thanks to Adnoh’s comment for pointing me to it.