Fix translation of extended keys.
Modified: branches/win32k rewrite attempt/win32k/include/input.h
Modified: branches/win32k rewrite attempt/win32k/ntuser/input.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/keyboard.c
_____
Modified: branches/win32k rewrite attempt/win32k/include/input.h
--- branches/win32k rewrite attempt/win32k/include/input.h
2005-08-07 11:47:50 UTC (rev 17160)
+++ branches/win32k rewrite attempt/win32k/include/input.h
2005-08-07 11:52:27 UTC (rev 17161)
@@ -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/win32k rewrite attempt/win32k/ntuser/input.c
--- branches/win32k rewrite attempt/win32k/ntuser/input.c
2005-08-07 11:47:50 UTC (rev 17160)
+++ branches/win32k rewrite attempt/win32k/ntuser/input.c
2005-08-07 11:52:27 UTC (rev 17161)
@@ -630,7 +630,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)
@@ -675,7 +675,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/win32k rewrite attempt/win32k/ntuser/keyboard.c
--- branches/win32k rewrite attempt/win32k/ntuser/keyboard.c
2005-08-07 11:47:50 UTC (rev 17160)
+++ branches/win32k rewrite attempt/win32k/ntuser/keyboard.c
2005-08-07 11:52:27 UTC (rev 17161)
@@ -981,7 +981,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;
@@ -999,6 +1003,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
&&
@@ -1020,11 +1025,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