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

Menubar menu item accelerators work only upon second pressing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u20
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:
      None
    • Environment:

      jdk1.8.0, jdk1.8.0_20
      Mac OS X 10.9.2

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              anthony Anthony Petrov (Inactive)
              Reporter:
              pfurbachejfx Paul Furbacher (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: