-
Bug
-
Resolution: Fixed
-
P4
-
8u20
-
None
-
jdk1.8.0, jdk1.8.0_20
Mac OS X 10.9.2
The application in question has a menubar and a number of menu items for advancing through “event” records — SHORTCUT_DOWN-] (next) and SHORTCUT_DOWN-[ (previous).
nextEventMenuItem.setAccelerator(KeyCombination.keyCombination(KeyCombination.SHORTCUT_DOWN + "+]"));
previousEventMenuItem.setAccelerator(KeyCombination.keyCombination(KeyCombination.SHORTCUT_DOWN + "+["));
The menubar and menu items, and handlers are set in the fxml, and the code for the handlers is in the controller. The accelerators shown above are set up in the @FXML “initialize()” method of the controller.
Once the UI is up and running, the first time I press either key-combo, nothing happens. The second time, the key event is “heard” and the next or previous event is shown.
If I use the mouse to navigate the menubar to these menu items, they work the first time they are selected from the menu. BUT, if after using the menu items to navigate between events, and then try using the key combos, they are dead the first time they are used. After that, they function properly.
I have written a barebones demo (app, controller, fxml) to show this behavior, but apparently cannot attach it to this report.
nextEventMenuItem.setAccelerator(KeyCombination.keyCombination(KeyCombination.SHORTCUT_DOWN + "+]"));
previousEventMenuItem.setAccelerator(KeyCombination.keyCombination(KeyCombination.SHORTCUT_DOWN + "+["));
The menubar and menu items, and handlers are set in the fxml, and the code for the handlers is in the controller. The accelerators shown above are set up in the @FXML “initialize()” method of the controller.
Once the UI is up and running, the first time I press either key-combo, nothing happens. The second time, the key event is “heard” and the next or previous event is shown.
If I use the mouse to navigate the menubar to these menu items, they work the first time they are selected from the menu. BUT, if after using the menu items to navigate between events, and then try using the key combos, they are dead the first time they are used. After that, they function properly.
I have written a barebones demo (app, controller, fxml) to show this behavior, but apparently cannot attach it to this report.
- relates to
-
JDK-8088025 KeyCombinations for brackets and regular characters work differently
- Open