<AWT Dev> [13] JDK-8218917: KeyEvent.getModifiers() returns inconsistent values for ALT keys

Krishna Addepalli krishna.addepalli at oracle.com
Wed Mar 6 06:44:11 UTC 2019

Hi All,

Please review a fix for https://bugs.openjdk.java.net/browse/JDK-8218917 <https://bugs.openjdk.java.net/browse/JDK-8218917>
With webrev: http://cr.openjdk.java.net/~kaddepalli/8218917/webrev00/ <http://cr.openjdk.java.net/~kaddepalli/8218917/webrev00/>

The problem is that once right alt key is pressed, pressing the left alt key always returns the key code for right alt key. The problem was in AWTEvent.m, there is a static variable “altGRPressed” which is being set once right alt is pressed, but is not being cleared when left alt key is pressed. The fix is to completely remove the “altGRPressed” variable as “leftAtlPressed” is sufficient to determine which alt key was pressed.
I have tested all the regressions associated with JDK-8156460, and found no new failures.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/awt-dev/attachments/20190306/0a8b43ed/attachment.html>

More information about the awt-dev mailing list