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

Philip Race philip.race at oracle.com
Mon Mar 11 14:43:02 UTC 2019

Having looked at this a little bit today it all makes no sense to me.
The work was done to prevent failure of a test which assumes AltGraph
is available, but it is not on Mac. So a Mac key was usurped to provide it.
When all we needed to do was disable the test on Mac

Since then for reasons that baffle me after adding the support, the test
has now been updated to not run on MacOS.

The reasoning that AltGraph might be useful to someone is a bit weak
and I don't think I'd want to support it via system property or build 

If its not a platform keyboard key, why do we need it ?

Back the fixes out all the way to before this started and keep the test 
on Mac - with appropriate tweaks - is what looks best to me.


On 3/11/19, 5:53 PM, Sergey Malenkov wrote:
> Hi Krishna,
>> The feature of ALT_GR support on Mac was not done by me, however looking at the bug, and the fact that Mac doesn’t have “AltGR” key, I’m wondering if it makes sense to have code that emits ALT_GR code?
> Sometimes it can be useful. For example, we can increase amount of
> shortcuts in our IDE, i.e. Alt+F ->  Alt+F&  AltGr+F. But, we should
> have an ability to turn this functionality off, because some Mac users
> want to use Alt+arrows with the right Alt key.
>> Also, even if we wanted to support it, I wouldn’t want to do it as a compile time flag. Ideally, it should be a flag that can be turned on/off at run time via a system property.
> This is a good idea. I've added a flag without a system property only
> to keep my patch as small as possible.

More information about the awt-dev mailing list