Accelerator in System MenuBar

Kevin Rushforth kevin.rushforth at
Wed Mar 20 23:41:23 UTC 2019

This seems a reasonable approach to me.

-- Kevin

On 3/19/2019 6:38 AM, Dean Wookey wrote:
> Returning a boolean in View.notifyKey may also be useful for the windows
> bug: where, regardless of
> whether the accelerator is missing or not, there is a beeping sound.
> Ideally there would be a beep only if the event isn't consumed.
> Dean
> On Tue, Mar 19, 2019 at 3:23 PM Johan Vos <johan.vos at> wrote:
>> Related to
>> The issue appears on Mac, with a system menubar. When the scene contains
>> e.g. a TextField (which has a CMD-V keymapping), and a menuitem has been
>> assigned a CMD-V accelerator, the latter should not be invoked when the
>> action is performed on the TextField.
>> When the menuitem is in a normal JavaFX MenuBar, this works fine as the
>> event handling marks the event as consumed when the TextField processes it,
>> hence it won't continue to the accelerators.
>> However, when the menuitem is in a system menubar, the native
>> performKeyEquivalent function first calls the the Java layer
>> (View.notifyKey) and then unconditionally passes the event so that the
>> system can process it.
>> My thinking is that this can be avoided by having the View.notifyKey
>> returning a boolean, which is true when the Java layer consumed the event,
>> in which case the native performKeyEquivalent should return YES.
>> Before I create a PR on this, I wonder if there are other ideas for doing
>> this?
>> - Johan

More information about the openjfx-dev mailing list