Misc: Close window if not docked, otherwise pass to main window
From CockosWiki
Sections: MIDI Editor, MIDI Event List Editor (Cmd ID 40477)
Closes the active MIDI editor/Event List window unless it's docked in Reaper's docker.
If the editor is docked, the assigned key will be handed over to the Main section of the Action List and triggers whatever action it is assigned to in that section.
Default key: Esc
Similar action: Misc: Pass through key to main window