JDK-7124286 : [macosx] Option modifier should work like AltGr as in Apple jdk 6
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: generic
  • Submitted: 2011-12-23
  • Updated: 2012-09-25
  • Resolved: 2012-04-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7u4 b18Fixed
http://java.net/jira/browse/MACOSX_PORT-654 submitted 2011/11/03 by Yuri Nesterenko
In Mac OS X, there's no AltGr key but regular Alt named Option should work in similar fashion. I'm afraid I've missed a discussion related to that so I'm filing a bug to attract attention (snapshot of kittens goes here).
Presently for instance Option + a in English US locale does not produce  (0xE5) and Option + 4 doesn't make a cent symbol 0xA2 like typing it in a console prompt does. It is a regression against Apple jdk 6.
Also, keytext for Option modifier is not defined neither in jdk 6 nor in this port.
I'm attaching a simple snippet printing key events just for convenience.

SUGGESTED FIX The check needs to be refactored out of the performAction() method, so it could be overridden with a platform specfic implementation.

EVALUATION There is a check in actionPerformed() method of DefaultEditorKit that ensures that the character we get as a result of pressing letter + some modifiers is a printable one. The problem with this check is that it reflects the way things works on Windows: it allows ctrl + alt + letter combinations and blocks anything else.