How to trigger event on escaping form text box input

Hi, I’m pretty new to UE5 and had a question regarding text boxes.

I am trying to trigger an event when a player hits ESC to exit a text box. I thought that this would qualify as losing" focus" or “keyboard focus”, but it seems like the text box only loses focus after I click elsewhere on the screen.

It makes sense that user input would be disabled while typing, but is there a way to whitelist specific inputs to bypass the user input restriction? And if not, through what method could I detect that a player has exited the text box prompt?