3 Replies Latest reply: Jun 3, 2011 3:58 PM by 854531 RSS

    KeyEvent key code problem

      This is about JavaFX 2.0.

      For the code fragment:
      flow.setOnKeyPressed(new EventHandler<KeyEvent>() {
                  public void handle(KeyEvent keyEvent) {
      When the SLASH key is pressed, breaking at the first line of the method "handle" gives keyEvent.getCode().ordinal() being 187. When the MINUS key is pressed, keyEvent.getCode().ordinal() is STILL 187. Previously in JavaFX 1.3, the code ordinal was 23 for SLASH and 21 for MINUS. Now I cannot tell which key is pressed! Yes I can look at the keyEvent.getText() property... but it really seems like a bug that the code is UNDEFINED, right?

      Thanks everyone :)

      Edited by: 851528 on Jun 3, 2011 12:10 AM