update text and key input events