support pressing ESC to hide main window