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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: fx2.1
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      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

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: