title: The player sticks on the screen for half a second while pressing 2 keys at the same time
body: <p>For the moment, I'm making a 2d rpg game in java.
  I just finished the KeyAdapter class and added it to my canvas:</p>
  
  <pre><code>public class KeyManager extends KeyAdapter {
  
      private float speed = 3;
  
      public void keyPressed(KeyEvent e) {
          int code = e.getKeyCode();
          if (code == KeyEvent.VK_UP) {
              Level.getLevel();
              Levels.setVelY(+speed);
          }
          if (code == KeyEvent.VK_DOWN) {
              Level.getLevel();
              Levels.setVelY(-speed);
          }
          if (code == KeyEvent.VK_LEFT) {
              Level.getLevel();
              Levels.setVelX(+speed);
          }
          if (code == KeyEvent.VK_RIGHT) {
              Level.getLevel();
              Levels.setVelX(-speed);
          }
          if (code == KeyEvent.VK_SHIFT) {
              speed = 5;
          }
      }
  
      public void keyReleased(KeyEvent e) {
          Level.getLevel();
          Levels.setVelX(0);
          Level.getLevel();
          Levels.setVelY(0);
          speed = 3;
      }
  
  }
  </code></pre>
  
  <p>In fact everything works okay, but if I press two keys at the same time(for example the up and right Arrowkey), my player stops moving (I think the good translation is sticks)for about half a second. Can someone explain me why that is and how I can solve the problem. It's pretty annoying.</p>
  
  <p>Thanks!</p>