Handle Time-Out events

Refactoring the InputController so there's less duplication. Also added
a time-out handler.