is it possible to handle esc key in the logic with ue5.3.2, rather than hijacked by the editor?

my game need to show ui and then press escape to enter the 3d scene again. but if i press escape, the play just ended.

thank u very much