MenuItem accelerator: nothing happens or NPE

Werner Lehmann lehmann at media-interactive.de
Tue Jan 8 02:37:09 PST 2013


Meanwhile we could workaround the problem with an event filter for 
KEY_PRESSED. I guess it is acceptable for just one shortcut (F1 for 
online help). But see below.

On 1/7/13 2:08 PM, Jonathan Giles wrote:
> A team mate of mine, Paru, informs me that everything is fixed in 8.0.
> It appears that in the case of F1, menu accelerators don't work as
> expected. I would be shocked if this breaks all accelerators in all
> cases. More likely it is just the case of the function keys.
>
> -- Jonathan

Unfortunately that is not the case. With

   new KeyCodeCombination(KeyCode.A, KeyCombination.CONTROL_DOWN)

the same NPE occurs. What's more, if I use

   new KeyCodeCombination(KeyCode.A, KeyCombination.META_DOWN)

there are two problems:

1. META maps to the windows key. Javadoc says it maps to the control key
on Windows.

> This is for example control on Windows and meta (command key) on Mac.
> By using shortcut key modifier developers can create platform
> independent shortcuts. So the "Shortcut+C" key combination is handled
> internally as "Ctrl+C" on Windows and "Meta+C" on Mac.
http://docs.oracle.com/javafx/2/api/javafx/scene/input/KeyCombination.html

2. The combination above is displayed as "Meta+A" on Windows. I would 
have expected "Ctrl+A", or even "Win+A" since "Meta" is not really a 
common keyname on Windows, especially for end-users...

Werner


More information about the openjfx-dev mailing list