prevent default behavior for arrow keys and tabs; setup focus whenever the display updates; fix a bug in typing