key events, close #2 and #4