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

Exclamation key is undefined (Azerty Keyboards)

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 7u40
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:
    • Environment:

      Windows 7 64bits

      Description

      On an azerty keyboard, when I press the key "!", the code of the key returned by KeyEvent is "Undefined".

      The "!" key is just on left of the right "shift" key. (see http://en.wikipedia.org/wiki/File:KB_France.svg )

      Snippet :

      public class KeyboardCodeViewer
          extends Application
      {

      public static void main(
      final String[] args)

      {
      KeyboardCodeViewer.launch(args);
      }

      private TextArea textArea;

      private Label label;

      @Override
      public void start(
      final Stage primaryStage)
      throws Exception
      {
      VBox root = new VBox();

      label = new Label("Coucou");
      label.setPrefSize(300d, 300d);
      label.setFocusTraversable(true);
      label.setOnKeyPressed(new EventHandler<KeyEvent>() {

      @Override
      public void handle(
      final KeyEvent event)
      {
      textArea.appendText(event.getCode().getName() + " : " + event.getCode().impl_getCode() + '\n');
      }
      });
      textArea = new TextArea();
      textArea.setPrefSize(300d, 300d);

      root.getChildren().add(label);
      root.getChildren().add(textArea);

      primaryStage.setScene(new Scene(root));
      primaryStage.sizeToScene();
      primaryStage.centerOnScreen();
      primaryStage.show();

      }
      }

      Start and then press a key, you should see the name and key code. But when you press "!", you'll get "Undefined"

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported: