Fix translation of extended keys.
Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/include/input.h
Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/input.c
Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/keyboard.c

Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/include/input.h
--- branches/ros-branch-0_2_7/reactos/subsys/win32k/include/input.h	2005-08-06 18:56:20 UTC (rev 17111)
+++ branches/ros-branch-0_2_7/reactos/subsys/win32k/include/input.h	2005-08-06 18:57:52 UTC (rev 17112)
@@ -10,7 +10,7 @@
 PUSER_MESSAGE_QUEUE W32kGetPrimitiveMessageQueue(VOID);
 VOID W32kUnregisterPrimitiveMessageQueue(VOID);
 PKBDTABLES W32kGetDefaultKeyLayout(VOID);
-VOID FASTCALL W32kKeyProcessMessage(LPMSG Msg, PKBDTABLES KeyLayout);
+VOID FASTCALL W32kKeyProcessMessage(LPMSG Msg, PKBDTABLES KeyLayout, BYTE Prefix);
 BOOL FASTCALL IntBlockInput(PW32THREAD W32Thread, BOOL BlockIt);
 BOOL FASTCALL IntMouseInput(MOUSEINPUT *mi);
 BOOL FASTCALL IntKeyboardInput(KEYBDINPUT *ki);

Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/input.c
--- branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/input.c	2005-08-06 18:56:20 UTC (rev 17111)
+++ branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/input.c	2005-08-06 18:57:52 UTC (rev 17112)
@@ -628,7 +628,7 @@
 
 	      lParam |= (KeyInput.MakeCode & 0xff) << 16;
 
-	      if (KeyInput.Flags & (KEY_E0 | KEY_E1))
+	      if (KeyInput.Flags & KEY_E0)
 	          lParam |= (1 << 24);
 
 	      if (ModifierState & MOD_ALT)
@@ -673,7 +673,9 @@
 	       * keyboard layout in use.
 	       */
 	      W32kKeyProcessMessage(&msg,
-				    FocusThread->Tcb.Win32Thread->KeyboardLayout);
+				    FocusThread->Tcb.Win32Thread->KeyboardLayout,
+				    KeyInput.Flags & KEY_E0 ? 0xE0 :
+				    (KeyInput.Flags & KEY_E1 ? 0xE1 : 0));
 
 	      if (GetHotKey(InputWindowStation,
 			    ModifierState,

Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/keyboard.c
--- branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/keyboard.c	2005-08-06 18:56:20 UTC (rev 17111)
+++ branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/keyboard.c	2005-08-06 18:57:52 UTC (rev 17112)
@@ -966,7 +966,11 @@
  * appropriately.
  */
 
-VOID FASTCALL W32kKeyProcessMessage(LPMSG Msg, PKBDTABLES KeyboardLayout) {
+VOID FASTCALL
+W32kKeyProcessMessage(LPMSG Msg,
+                      PKBDTABLES KeyboardLayout,
+                      BYTE Prefix)
+{
   DWORD ScanCode = 0, ModifierBits = 0;
   DWORD i = 0;
   DWORD BaseMapping = 0;
@@ -984,6 +988,7 @@
       { VK_UP,     VK_NUMPAD8 },
       { VK_PRIOR,  VK_NUMPAD9 },
       { 0,0 } };
+  PVSC_VK VscVkTable;
 
   if( !KeyboardLayout || !Msg ||
       (Msg->message != WM_KEYDOWN && Msg->message != WM_SYSKEYDOWN &&
@@ -1005,11 +1010,41 @@
   ScanCode = (Msg->lParam >> 16) & 0xff;
   BaseMapping = Msg->wParam =
     IntMapVirtualKeyEx( ScanCode, 1, KeyboardLayout );
-  if( ScanCode >= KeyboardLayout->bMaxVSCtoVK )
-    RawVk = 0;
+  if( Prefix == 0 )
+    {
+      if( ScanCode >= KeyboardLayout->bMaxVSCtoVK )
+        RawVk = 0xff;
+      else
+        RawVk = KeyboardLayout->pusVSCtoVK[ScanCode];
+    }
   else
-    RawVk = KeyboardLayout->pusVSCtoVK[ScanCode];
+    {
+      if( Prefix == 0xE0 )
+        {
+          /* ignore shift codes */
+          if( ScanCode == 0x2A || ScanCode == 0x36 )
+            {
+              IntUnLockQueueState;
+              return;
+            }
+          VscVkTable = KeyboardLayout->pVSCtoVK_E0;
+        }
+      else if( Prefix == 0xE1 )
+        {
+          VscVkTable = KeyboardLayout->pVSCtoVK_E1;
+        }
 
+      RawVk = 0xff;
+      while (VscVkTable->Vsc)
+        {
+          if( VscVkTable->Vsc == ScanCode )
+            {
+              RawVk = VscVkTable->Vk;
+            }
+          VscVkTable++;
+        }
+    }
+
   if ((ModifierBits & NUMLOCK_BIT) &&
       !(ModifierBits & GetShiftBit(KeyboardLayout, VK_SHIFT)) &&
       (RawVk & KNUMP) &&