Implemented keypress events.