Both input and ouput hooks check for keyboard events

Having both hooks check for keyboard events vastly improves the
stability of a2term