Implemented pressing key event