i would use a state machine structure and run it outside of the switch statement so it gets executed on every loop. use keystrokes and timers as inputs


state = 0;
...
loop
....
switch()...