<AWT Dev> Review request for 8041928: MouseEvent.getModifiersEx gives wrong result

Ambarish Rapte ambarish.rapte at oracle.com
Wed Dec 9 15:30:06 UTC 2015


                Please review the fix for JDK9

                Bug: https://bugs.openjdk.java.net/browse/JDK-8041928

Webrev: http://cr.openjdk.java.net/~arapte/8041928/webrev.00/



The 8041928 issue mentions below problems with the modifiers,

1.       When clicking right button it gives Button3 and the Meta key modifiers.

2.       Alt-Gr modifier is not set.




1.       When clicking right button it gives Button3 and the Meta key modifiers.

This is actually not an issue, the right mouse button (BUTTON3_MASK) click and META key  (META_MASK) share same bit in modifiers.

Please check documentation here,


The important statement from this doc:

(Note: Due to overlap in the values of ALT_MASK/BUTTON2_MASK and META_MASK/BUTTON3_MASK, this is not always true for mouse events involving modifier keys)


2.       Alt-Gr modifier is not set.

This is an issue, and the patch fixes this issue for Windows.

Also added related manual test.

This bug does not happen on Linux,

But occurs with MACOSX,  Shall raise a new MACOSX specific bug to continue work.




Added check for key code VK_RMENU for windows, while creating the java Modifiers of event.

The related test is manual because,

1.       Robot cannot generate the Alt-Gr key event

2.       There are different keyboard layouts, A keyboard may have Alt-Gr key or might have to use Ctrl-Alt combination.

3.       For Linux - ubuntu, The alternate graphics key needs to be enabled explicitly from System Keyboard settings.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20151209/9397c4b0/attachment-0001.html>

More information about the awt-dev mailing list