6253172: Some key characters on none US keyboard cannot be typed since JDK 1.4
authoryan
Wed, 21 May 2008 10:28:19 +0400
changeset 636 33bcd22c57ff
parent 635 7843f98417d1
child 637 381574d35e99
6253172: Some key characters on none US keyboard cannot be typed since JDK 1.4 Summary: Windows-only problem fixed by applying 4737679/4623376 fix to navigation keys only. Reviewed-by: son
jdk/src/windows/native/sun/windows/awt_Component.cpp
jdk/src/windows/native/sun/windows/awt_Component.h
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp	Fri May 16 04:37:47 2008 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp	Wed May 21 10:28:19 2008 +0400
@@ -3464,6 +3464,21 @@
     return java_awt_event_KeyEvent_VK_UNDEFINED;
 }
 
+BOOL AwtComponent::IsNavigationKey(UINT wkey) {
+    switch (wkey) {
+      case VK_END:
+      case VK_PRIOR:  // PageUp
+      case VK_NEXT:  // PageDown
+      case VK_HOME:
+      case VK_LEFT:
+      case VK_UP:
+      case VK_RIGHT:
+      case VK_DOWN:
+          return TRUE;
+    }
+    return FALSE;
+}
+
 // determine if a key is a numpad key (distinguishes the numpad
 // arrow keys from the non-numpad arrow keys, for example).
 BOOL AwtComponent::IsNumPadKey(UINT vkey, BOOL extended)
@@ -3563,7 +3578,10 @@
         // fix for 4623376,4737679,4501485,4740906,4708221 (4173679/4122715)
         // Here we try to resolve a conflict with ::ToAsciiEx's translating
         // ALT+number key combinations. kdm@sarc.spb.su
-        keyboardState[VK_MENU] &= ~KEY_STATE_DOWN;
+        // yan: Do it for navigation keys only, otherwise some AltGr deadkeys fail.
+        if( IsNavigationKey(wkey) ) {
+            keyboardState[VK_MENU] &= ~KEY_STATE_DOWN;
+        }
 
         if (ctrlIsDown)
         {
--- a/jdk/src/windows/native/sun/windows/awt_Component.h	Fri May 16 04:37:47 2008 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Component.h	Wed May 21 10:28:19 2008 +0400
@@ -823,6 +823,7 @@
 private:
     AwtComponent* SearchChild(UINT id);
     void RemoveChild(UINT id) ;
+    static BOOL IsNavigationKey(UINT wkey);
 
     ChildListItem* m_childList;