8022997: [macosx] Remaining duplicated key events
authorleonidr
Thu, 15 Aug 2013 01:17:30 +0400
changeset 19365 9b91cc0d659c
parent 19364 f6324eb18ece
child 19366 5286ad9a6ff2
8022997: [macosx] Remaining duplicated key events Reviewed-by: anthony, serb
jdk/src/macosx/native/sun/awt/CMenuItem.m
jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java
--- a/jdk/src/macosx/native/sun/awt/CMenuItem.m	Wed Aug 14 17:20:09 2013 +0400
+++ b/jdk/src/macosx/native/sun/awt/CMenuItem.m	Thu Aug 15 01:17:30 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/jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Wed Aug 14 17:20:09 2013 +0400
+++ b/jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Thu Aug 15 01:17:30 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;