JDK-8088120 : [Accelerator, Mac] CMD + Z accelerator is not working with French keyboard
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 8u40,9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2014-09-17
  • Updated: 2023-12-21
  • Resolved: 2023-12-21
Related Reports
Duplicate :  
Description
Run this sample test : 


import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.MenuButton;
import javafx.scene.control.MenuItem;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import javafx.scene.input.KeyCombination;
import javafx.stage.Stage;

public class TestshortcutZ extends Application{

    
    public static void main(String[] args) {
        launch(args);
    }
    
    @Override
    public void start(Stage primaryStage) throws Exception {
        MenuButton button = new MenuButton("test");
        MenuItem item = new MenuItem("test");
        item.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent event) {
                System.out.println("TRIGGERED");
            }
        });
        item.setAccelerator(new KeyCodeCombination(KeyCode.Z, KeyCombination.SHORTCUT_DOWN));
        
        button.getItems().add(item);
        
        Scene scene = new Scene(button);
        primaryStage.setScene(scene);
        primaryStage.setMinHeight(300);
        primaryStage.setMinWidth(100);
        primaryStage.show();
    }
}


Try to to CMD + Z with a Mac, nothing happened. If you do it with Windows, the command will become "CTRL+Z" and it is working.

I have tested it with 8u20, I don't have the 8u40 right now on my Mac so I need a confirmation for that version.
Comments
checking the existing patch to see if it works
20-01-2017

As there's a patch available could someone please take a look?
20-01-2017

Could someone review it: > Please review - http://cr.openjdk.java.net/~morris/RT-38694.01/
20-05-2016

Please review - http://cr.openjdk.java.net/~morris/RT-38694.01/
14-01-2015

I can reproduce this on my Mac. I'm running 10.10.1.
14-11-2014

No update yet. We will likely retarget it for JDK 9, since we are almost out of time for 8u40.
14-11-2014

Do we have an update on this?
14-11-2014

In this case it is may be a Glass issue rather than a controls issue.
19-09-2014

Allright I think I have narrow down the problem. My computer and keyboard is in French, therefore in AZERTY. So I assigned my accelerator to CMD-Z. If I use the key Z, nothing is happening. But if I press my key "W", it's working. So it seems that JavaFX thinks that my keyboard is in QWERTY, therefore pressing my "Z" key will be computed as a "W". Weird thing is that my keyboard is well detected, if I type in a TextField, the right letters are printed. I think that explains why you can't reproduce since you have a QWERTY keyboard.
19-09-2014

I just download latest 8u40 b05 build, and I still have the problem on my Mac.
19-09-2014

Please reopen this bug if it the problem is still happening for you in an 8u40 EA. Thanks.
17-09-2014

I just ran this code on 8u40 dev and it works for me (it prints TRIGGERED).. Can you get an 8u40 EA build and confirm that the bug is fixed for you?
17-09-2014