Moved keyboard FSM into context.