Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8087486

[Glass, Linux, Mac, Monocle] KeyCharacterCombination matching for tab and newline is broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • javafx

      See RT-38778 for more details. Sample:

      public class Hello {
          static class KeyPair {
              private String character;
              private KeyCode code;

              KeyPair(String character, KeyCode code) {
                  this.character = character;
                  this.code = code;
              }
          }

          public static void main(String[] args) {
              new JFXPanel(); // initialize JavaFX

              for (KeyPair kp : Arrays.asList(new KeyPair("\n", KeyCode.ENTER), new KeyPair("\t", KeyCode.TAB))) {
                  KeyCharacterCombination kcc = new KeyCharacterCombination(kp.character);
                  KeyEvent event = new KeyEvent(KeyEvent.KEY_PRESSED, kp.character, "", kp.code, false, false, false, false);
                  System.out.println("KeyCode." + kp.code.getName() + " matches: " + kcc.match(event)); // true (!!!)
              }

              Platform.exit();
          }
      }

            mfox Martin Fox
            msladecek Martin Sládeček
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Imported: