title: How can I move image with the KeyBoard using 2 keys?
body: <p>I have a problem that I'm struggling with..
  I want to move an image using my keyboard to the left, right, up or down and in a diagonal way.
  I searched the web and found, that to use 2 diffrent keys I need to remember the previous key, so for that I'm using a bool dictionary.</p>
  
  <p>in my main Form class this is how the KeyDown event looks like:</p>
  
  <pre><code>private void Form1_KeyDown(object sender, KeyEventArgs e)
  {
      baseCar.carAccelerate(e.KeyCode.ToString().ToLower());
      carBox.Refresh(); //carbox is a picturebox in my form that store the image I want to move.
  }
  </code></pre>
  
  <p>My KeyUp event:</p>
  
  <pre><code>private void Form1_KeyUp(object sender, KeyEventArgs e)
  {
      baseCar.carBreak(e.KeyCode.ToString().ToLower());
  }
  </code></pre>
  
  <p>My Paint event:</p>
  
  <pre><code>private void carBox_Paint(object sender, PaintEventArgs e)
  {
      e.Graphics.DrawImage(Car, baseCar.CharPosX, baseCar.CharPosY); // Car is just an image
  }
  </code></pre>
  
  <p>And my baseCar class:</p>
  
  <p>private Dictionary KeysD = new Dictionary();
  // there is a method to set the W|A|S|D Keys, like: KeysD.Add("w",false)</p>
  
  <pre><code>    public void carAccelerate(string moveDir)
      {       
          KeysD[moveDir] = true;
          moveBeta();
      }
      public void moveBeta()
      {
          if (KeysD["w"])
          {
              this.CharPosY -= this.carMoveYSpeed;
          }
          if (KeysD["s"])
          {
              CharPosY += carMoveYSpeed;
          }
          if (KeysD["a"])
          {
              CharPosX -= carMoveXSpeed;
          }
          if (KeysD["d"])
          {
              CharPosX += carMoveXSpeed;
          }
      }
      public void carBreak(string str)
      {
          KeysD[str] = false;
      }
  </code></pre>
  
  <p>Anyway it works, but my problem is that I can't get back to the first pressed key for example:</p>
  
  <p>I pressed W to move up and then the D key to go diagonal, how ever when I release the D key it wont go Up again because the KeyDown event is "dead" and wont call the carAccelerate() method again..
  and I can't figure out how to fix it..</p>
  
  <p>Can any one help me please?
  Maybe there is a better way to handle the keys? im open to any ideas!
  And I hope you can understand it, my english isnt the best :S</p>