Unfortunately, it seems that it is currently not possible to receive shortcuts when a textfield is active. So when the the equation is in focus it will not trigger the shortcut :-( The only way to close the UI with the shortcut is to "not have the input field active".