changeset 6552:df8dd2c6a7ca

8022997: [macosx] Remaining duplicated key events Reviewed-by: anthony, serb
author leonidr
date Tue, 20 Aug 2013 18:56:58 +0400
parents 8bc401414049
children a8ecb75bd810
files src/macosx/native/sun/awt/CMenuItem.m test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/native/sun/awt/CMenuItem.m	Mon Aug 19 16:40:38 2013 +0400
+++ b/src/macosx/native/sun/awt/CMenuItem.m	Tue Aug 20 18:56:58 2013 +0400
@@ -296,7 +296,7 @@
 
         case java_awt_event_KeyEvent_VK_HELP            : macKey = NSHelpFunctionKey; break;
         case java_awt_event_KeyEvent_VK_TAB             : macKey = NSTabCharacter; break;
-        case java_awt_event_KeyEvent_VK_ENTER           : macKey = NSCarriageReturnCharacter; break;
+        case java_awt_event_KeyEvent_VK_ENTER           : macKey = NSNewlineCharacter; break;
         case java_awt_event_KeyEvent_VK_BACK_SPACE      : macKey = NSBackspaceCharacter; break;
         case java_awt_event_KeyEvent_VK_DELETE          : macKey = NSDeleteCharacter; break;
         case java_awt_event_KeyEvent_VK_CLEAR           : macKey = NSClearDisplayFunctionKey; break;
--- a/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Mon Aug 19 16:40:38 2013 +0400
+++ b/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Tue Aug 20 18:56:58 2013 +0400
@@ -35,11 +35,12 @@
 import javax.swing.*;
 
 public class ActionListenerCalledTwiceTest {
-    static String menuItems[] = { "Item1", "Item2", "Item3" };
+    static String menuItems[] = { "Item1", "Item2", "Item3", "Item4" };
     static KeyStroke keyStrokes[] = {
         KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK),
         KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
         KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK),
+        KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.META_MASK)
     };
 
     static volatile int listenerCallCounter = 0;