Move key event processing to keyTyped