Setup a rudimentary state machine for handling input