Fix translation of extended keys.
Modified: trunk/reactos/subsys/win32k/include/input.h
Modified: trunk/reactos/subsys/win32k/ntuser/input.c
Modified: trunk/reactos/subsys/win32k/ntuser/keyboard.c
_____
Modified: trunk/reactos/subsys/win32k/include/input.h
--- trunk/reactos/subsys/win32k/include/input.h 2005-08-06 18:08:07 UTC
(rev 17110)
+++ trunk/reactos/subsys/win32k/include/input.h 2005-08-06 18:56:20 UTC
(rev 17111)
@@ -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: trunk/reactos/subsys/win32k/ntuser/input.c
--- trunk/reactos/subsys/win32k/ntuser/input.c 2005-08-06 18:08:07 UTC
(rev 17110)
+++ trunk/reactos/subsys/win32k/ntuser/input.c 2005-08-06 18:56:20 UTC
(rev 17111)
@@ -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: trunk/reactos/subsys/win32k/ntuser/keyboard.c
--- trunk/reactos/subsys/win32k/ntuser/keyboard.c 2005-08-06
18:08:07 UTC (rev 17110)
+++ trunk/reactos/subsys/win32k/ntuser/keyboard.c 2005-08-06
18:56:20 UTC (rev 17111)
@@ -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) &&
Show replies by date