a Key driver which contain a simple state machine.