Added Keypress events for exiting.