mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fix translation of extended keys.
svn path=/trunk/; revision=17111
This commit is contained in:
parent
f3594ebab5
commit
4123ecfc6a
3 changed files with 44 additions and 7 deletions
|
@ -10,7 +10,7 @@ InitKeyboardImpl(VOID);
|
|||
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);
|
||||
|
|
|
@ -628,7 +628,7 @@ KeyboardThreadMain(PVOID StartContext)
|
|||
|
||||
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 @@ KeyboardThreadMain(PVOID StartContext)
|
|||
* 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,
|
||||
|
|
|
@ -966,7 +966,11 @@ NtUserGetKeyNameText( LONG lParam, LPWSTR lpString, int nSize ) {
|
|||
* 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 @@ VOID FASTCALL W32kKeyProcessMessage(LPMSG Msg, PKBDTABLES KeyboardLayout) {
|
|||
{ 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,10 +1010,40 @@ VOID FASTCALL W32kKeyProcessMessage(LPMSG Msg, PKBDTABLES KeyboardLayout) {
|
|||
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)) &&
|
||||
|
|
Loading…
Reference in a new issue