thread for key events
thread for key events