RFR: 8064787: [macosx] In Nimbus LaF, Ctrl+Alt mnemonic doesn't work
Damon Nguyen
dnguyen at openjdk.org
Tue Aug 2 19:07:40 UTC 2022
On Thu, 14 Jul 2022 08:03:34 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> In SwingSet2 application, "File" menu has a visible mnemonic set on F.
>
> 
>
> Now, in MacOS, with Aqua, Java (Metal), and Motif LaF, one can open the menu pressing Ctrl+Alt+F.
> But with Nimbus L&F, to open File menu, you have to press Alt+F even on OS X.
>
> It should work with Ctrl+Alt+F as sun/lwawt/macosx/LWCToolkit.java. getFocusAcceleratorKeyMask()
> has CTRL_MASK | ALT_MASK
>
> Fix is to add Menu.shortcutKeys in SynthLookAndFeel default table so that it can call SwingUtilities2.getSystemMnemonicKeyMask() which will call either LWCToolkit.getFocusAcceleratorKeyMask() or SunToolkit.getFocusAcceleratorKeyMask() depending on platform.
>
> No regression test is added as it can be checked with SwingSet2 app.
Applied change locally and tested on SwingSet2. Nimbus now behaves like the other L&Fs described.
-------------
Marked as reviewed by dnguyen (Author).
PR: https://git.openjdk.org/jdk/pull/9488
More information about the client-libs-dev
mailing list