title: switch statement with off/on boolean
body: <p>I've been looking everywhere for this, but haven't found an answer. What I'm trying to achieve is an off/on boolean with a <code>switch</code> statement, so multiple options by toggling one key, so if I press, for example, the <code>up</code> arrow it toggles the first case. If I press it again it toggles the second case and then the third and so on. It doesn't need to be a <code>switch</code> statement, just anything that would work, please point me in the right direction, thanks in advance.</p>
  
  <p>This is how an offon boolean is done without <code>switch</code> statement, so you get an idea what im searching for.</p>
  
  <pre><code>static bool onoff = false;
  
  if (GetAsyncKeyState(VK_UP) &amp; 1)
  {
      onoff = !onoff;
      Sleep(100);
  }
  
  if (onoff)
  {
      //code
  }
  </code></pre>