JDK-7156393 : [macosx] Mnemonics don't work
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7,8,9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: generic,x86
  • Submitted: 2012-03-23
  • Updated: 2022-08-25
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.
Other
tbdUnresolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Mnemonics do not work in Mac OS X because e.getKeyChar() method from the KeyEvent returns different key char which is not in range 'a'..'z', 'A'..'Z'

For example: type A
---------------------
key code: 65
key char: 
key char int: 1
---------------------
To reproduce the issue run the test javax/swing/JTabbedPane/4624207/bug4624207.java
See also issue 7151821

Comments
we test jdk9b73(64bit) on mac10.10-x64,It failed as the same issue. Alt+Tab doesn't work in JTabbedPane,but Ctrl+Alt+tab work.
21-07-2015

RULE Swing_JTabbedPane/Manual/JTabbedPaneLAFTests/TabbedPaneLAFTest1 ExitCode 1
30-04-2015

EVALUATION The problem is the following: on Cocoa level, there is no difference between pressing ctrl+c and ctrl+alt+c, in both cases NSEvent's -characters method returns 0x03 as the character typed. While this is exactly what we want in case of ctrl+c, in order for the ctrl+alt+c mnemonic to work, we have to return 'c' instead, even if it contradicts the way OS X works. Proposed fix: http://cr.openjdk.java.net/~alexsch/7151821/webrev.00/
23-03-2012