learn keyboard event-handler to close the window