to close the second menu, and use anything there

I want to use the keys that players usually use for everything, the P key opens a radio message window, with this method I could close it and use my own graphic menu there, I don't have an obsession with graphic menus, I'm just looking for accessibility for our beloved game