JDK-8087884 : Exclamation key is undefined (Azerty Keyboards)
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 7u40
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2013-09-30
  • Updated: 2021-12-18
  • Resolved: 2021-12-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Relates :  
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"
Comments
Duplicate of JDK-8123632 which was fixed long ago. No longer reproducible.
18-12-2021

Assigning to Alexander. A similar bug exists for Mac: RT-30669. It looks like Glass doesn't support the azerty kbd layout properly on all platforms.
02-10-2013

I was able to reproduce this on Windows with French keyboard layout. Assigning to Glass, the key code is 0 when the KeyEvent is created (in GlassViewEventHandler.KeyEventNotification).
02-10-2013

Assign to scene graph, but might be a Glass issue.
01-10-2013