Attach an escape key handler.