1

This question seems to have been asked before, but there is no answer:

JavaFX strange menu accelerator behaviour

I have declared a Menu with a few Menu Items in FXML and have also declared the accelerators in FXML.

<Menu mnemonicParsing="false" text="View">
    <items>
      <MenuItem mnemonicParsing="false" onAction="#increaseFont" text="Increase font">
          <accelerator>
            <KeyCodeCombination alt="UP" code="EQUALS" control="UP" meta="UP" shift="UP" shortcut="DOWN" />
          </accelerator>
      </MenuItem>
      <MenuItem mnemonicParsing="false" onAction="#decreaseFont" text="Decrease font">
          <accelerator>
            <KeyCodeCombination alt="UP" code="SUBTRACT" control="UP" meta="UP" shift="UP" shortcut="DOWN" />
          </accelerator>
      </MenuItem>
    </items>
</Menu>

However, this is giving me very odd results while the program is running. Both the accelerators do not work and the SUBTRACT key turns up as an M key in the menu and works when the M key is pressed.

NOTE: I have also declared other menu items which are working just fine. Those items use the accelerators cmd-rightarrow, cmd-leftarrow, cmd-D, cmd-N and cmd-O. However, these two accelerators don't seem to work.

Is this a mac problem? My implementation seems to be correct. Any help on this topic will be appreciated!

EDIT: As seen in the comments, this looks like a mac only problem. It will be really helpful if somebody with a mac can check this bug out.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Aniruddha Deb
  • 272
  • 2
  • 7

0 Answers0