Can I use the Escape key as a shortcut for closing UI windows?

I figured maybe returning Enum.ContextActionResult.Sink would do it, but ContextActionService never actually detects the escape button being pressed in the first place. It always opens the system menu. I would like to intercept the escape button to act as a shortcut to close any open in-game menus before reverting to the default unhandled behavior, just like you would expect in any other application, but this behavior seems to be complicated or not supported in Roblox.

I guess you could check for when the pause menu is opened and use that, but currently there is no way to get rid of the default menu