8073008: press-and-hold input method for accented characters works incorrectly on OS X
authoranashaty
Mon, 16 Mar 2015 20:32:45 +0300
changeset 29727 34e49b091c62
parent 29726 68195efbe982
child 29728 0c2a0a8ada0c
8073008: press-and-hold input method for accented characters works incorrectly on OS X Reviewed-by: azvegint, alexp
jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Thu Mar 12 08:57:51 2015 -0700
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Mon Mar 16 20:32:45 2015 +0300
@@ -311,7 +311,10 @@
 }
 
 - (BOOL) performKeyEquivalent: (NSEvent *) event {
-    [self deliverJavaKeyEventHelper: event];
+    // if IM is active key events should be ignored 
+    if (![self hasMarkedText] && !fInPressAndHold) {
+        [self deliverJavaKeyEventHelper: event];
+    }
 
     // Workaround for 8020209: special case for "Cmd =" and "Cmd ." 
     // because Cocoa calls performKeyEquivalent twice for these keystrokes