Added ev.keyCode == 27 for ESC key