JDK-8073008 : press-and-hold input method for accented characters works incorrectly on OS X
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8u31,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-02-12
  • Updated: 2015-10-20
  • Resolved: 2015-03-16
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.
JDK 7 JDK 8 JDK 9
7u85Fixed 8u45Fixed 9 b59Fixed
Related Reports
Duplicate :  
Description
Mac OS supports input of accented characters using a native popup which shows
up when certain character keys are held pressed for some time
(http://support.apple.com/kb/PH11264). This method works incorrectly in Swing
text input components when arrow keys are used to select desired character in
the popup.
Comments
[self hasMarkedText] - indicates that the native IM is currently in progress fInPressAndHold - no markedText yet but the IM is actually started already: the native lookup window is displayed and it should handle all key events
12-03-2015

On Mac the unwanted key events are delivered via performKeyEquivalent which is invoked independently of whether the native IM is currently active. When the IM is inactive these key events (cursor keys, enter, etc) are delivered by both performKeyEquivalent and keyDown callbacks. The duplicate event coming via keyDown is then ignored (deliverJavaKeyEventHelper). There are two possible solutions: - create a map of key event types which are also received by keyDown and ignore them in performKeyEquivalent - ignore performKeyEquivalent when the IM is active ([self hasMarkedText] || fInPressAndHold) which is also done in the keyDown handler + when the NSEvent.willBeHandledByComplexInputMethod flag is set
12-03-2015

No reg test since native IMs don't handle awt.Robot events on Mac
12-03-2015

On Windows this works due to Win sending VK_PROCESSKEY instead of a real key code when the IM is active and thus the key pressed event is not generated.
19-02-2015