What text editor under OS X can close current window when you press ESC key?
Emacs allows you to override shortcuts keys.

Add this line to your .emacs file (located in your home directory) :  

(global-set-key (kbd "&lt;escape&gt;") 'save-buffers-kill-emacs)