# HG changeset patch # User ant # Date 1337275639 -14400 # Node ID fa378682b3cb6e8338681538eb360d97d9681073 # Parent 4eaff968067426e34b4283db3c47c4023e042c36 7142565: [macosx] Many special keys processed twice in text fields Summary: forward port from 7u4 Reviewed-by: anthony diff -r 4eaff9680674 -r fa378682b3cb jdk/src/macosx/native/sun/awt/AWTView.m --- a/jdk/src/macosx/native/sun/awt/AWTView.m Thu May 17 15:41:09 2012 +0400 +++ b/jdk/src/macosx/native/sun/awt/AWTView.m Thu May 17 21:27:19 2012 +0400 @@ -48,7 +48,6 @@ //#define IM_DEBUG TRUE //#define EXTRA_DEBUG - static BOOL shouldUsePressAndHold() { static int shouldUsePressAndHold = -1; if (shouldUsePressAndHold != -1) return shouldUsePressAndHold; @@ -394,6 +393,13 @@ } -(void) deliverJavaKeyEventHelper: (NSEvent *) event { + static id sUnretainedLastKeyEvent = nil; + if (event == sUnretainedLastKeyEvent) { + // The event is repeatedly delivered by keyDown: after performKeyEquivalent: + return; + } + sUnretainedLastKeyEvent = event; + [AWTToolkit eventCountPlusPlus]; JNIEnv *env = [ThreadUtilities getJNIEnv];