title: Trouble with KeyEvent and KeyStroke
body: <p>I noticed that I get two different <code>keyCode</code> for the same <code>Char</code>. Here is a little experiment:</p>
  
  <pre><code>package main;
  
  import com.sun.javafx.scene.control.Keystroke;
  
  import javax.swing.*;
  import java.awt.event.KeyEvent;
  import java.awt.event.KeyListener;
  
  public class Keystroketest {
      public static void main(String[] args) {
          final KeyStroke ks = KeyStroke.getKeyStroke('e', 0);
          System.out.println(ks.getKeyCode());
  
          JFrame f = new JFrame();
          JTextField jtf = new JTextField("");
          f.setBounds(300, 300, 100, 60);
          f.add(jtf);
          f.setVisible(true);
  
  
          jtf.addKeyListener(new KeyListener() {
              @Override
              public void keyTyped(KeyEvent keyEvent) {
              }
  
              @Override
              public void keyPressed(KeyEvent keyEvent) {
              }
  
              @Override
              public void keyReleased(KeyEvent keyEvent) {
                  System.out.println(keyEvent.getKeyCode());
                  if (keyEvent.getKeyCode() == ks.getKeyCode()) {
                      System.out.println("letters are similar");
                  } else {
                      System.out.println("letters aren't similar");
                  }
              }
          });
      }
  }
  </code></pre>
  
  <p>If I type in the <code>textField</code> the letter "e" so it returns a different <code>KeyCode</code> for the same letter when I parse it.</p>
  
  <p>Whats the reason? And how can I check if the letter/char I typed is the same as in a specific char defined in the code as above...?</p>
  
  <p>So whenever I check the <code>KeyCode</code> I typed, java thinks I didn't type the same letter. But that's not correct I think.</p>