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

KeyCode returns "EQUALS" instead of "PLUS" when pressing the plus-key

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • None
    • fx2.1
    • javafx
    • WXP, JFX 2.1b14

    Description

      Creating a key binding to the keyboard plus key does not work:

      KEY_BINDINGS.add( new KeyBinding(KeyCode.PLUS, EVENT_NEXT) );

      More closely examining the problem it turns out that the "+" key, being accessed by "SHIFT =" is being, returned as two separate events; one for SHIFT and one for EQUALS

      this.setOnKeyPressed(new EventHandler<KeyEvent>()
      {
                  @Override public void handle(KeyEvent t)
                  {
                   System.out.println("code=" + t.getCode() + ", text=" + t.getText());
                  }
              });

      code=SHIFT, text=
      code=EQUALS, text=+

      Note that the text correctly returns "+". Something does not seem to be right there.

      Attachments

        Activity

          People

            psafrata Pavel Ĺ afrata
            tbee Tom Eugelink
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: