On Mon, 30 Mar 2026 09:24:03 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> A proposal to add getSystemMnemonicKeyMask to SwingUtilities so as to make 
>> it publicly accessible from inner SwingUtilities2 class to allow custom L&F 
>> to set the own shortcut keys
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Add mnemonic mask test

src/java.desktop/share/classes/javax/swing/SwingUtilities.java line 907:

> 905:     /**
> 906:      * Returns the system mnemonic key mask to be used
> 907:      * for shortcut keymask and/or accelerator keymask

IMO that is too vague. I'd like to see more precise and more helpful / 
descriptive text here.

Also I see that SU2 will return ALT_MASK and I wonder if it (and SunToolkit of 
course) should be returning ALT_DOWN_MASK instead ?
 
And since this is a JDK defined mask, maybe entirely for Swing, isn't the word 
"System" is mis-leading ?
Meaning if there's a look up anywhere of what the desktop expects, I'm missing 
it.

test/jdk/javax/swing/SwingUtilities/TestAcceleratorMask.java line 94:

> 92:         if ((mod & (InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK)) 
> != 0) {
> 93:             return KeyEvent.VK_SHIFT;
> 94:         }

Since SFAICS we always return VK_ALT, what was the reason for checking the 
other masks ?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30366#discussion_r3011779708
PR Review Comment: https://git.openjdk.org/jdk/pull/30366#discussion_r3011784955

Reply via email to