Implemented treat close as escape key.