title: Why are my Keyevents not working?
body: <p>I am working on a game in Java which uses Keyevents. Basically, it is a template which I wanted to enhance but now I am struggling with some basic stuff. Here it goes:</p>
  
  <p>In the keyPressed() method are a number of events, like this:</p>
  
  <pre><code>public void keyPressed(int key) {
      switch (key) {
      case KeyEvent.VK_A:
          System.out.println("A");
          methodA();
          break;
      case KeyEvent.VK_B:
          System.out.println("B");
          methodB();
          break;
      }
  }
  </code></pre>
  
  <p>However, when I try to add another KeyEvent, like <code>KeyEvent.VK_1</code> , it does not work/ the key is not recognized. Why is that? Am I missing something?</p>