- Improve formating of input.c and keyboard.c

svn path=/trunk/; revision=53660
This commit is contained in:
Rafal Harabien 2011-09-09 16:17:02 +00:00
parent 5f3b37f429
commit d18bfcff5e
2 changed files with 2128 additions and 2127 deletions

View file

@ -687,7 +687,7 @@ KeyboardThreadMain(PVOID StartContext)
NULL, NULL,
NULL); NULL);
TRACE("KeyRaw: %s %04x\n", TRACE("KeyRaw: %s %04x\n",
(NextKeyInput.Flags & KEY_BREAK) ? "up":"down", (NextKeyInput.Flags & KEY_BREAK) ? "up" : "down",
NextKeyInput.MakeCode ); NextKeyInput.MakeCode );
if (Status == STATUS_ALERTED && !InputThreadsRunning) if (Status == STATUS_ALERTED && !InputThreadsRunning)
@ -739,7 +739,7 @@ KeyboardThreadMain(PVOID StartContext)
UserEnterExclusive(); UserEnterExclusive();
for (;NumKeys;memcpy(&KeyInput, &NextKeyInput, sizeof(KeyInput)), for (; NumKeys; memcpy(&KeyInput, &NextKeyInput, sizeof(KeyInput)),
NumKeys--) NumKeys--)
{ {
PKBL keyboardLayout = NULL; PKBL keyboardLayout = NULL;
@ -875,7 +875,7 @@ KeyboardThreadMain(PVOID StartContext)
/* /*
* Post a keyboard message. * Post a keyboard message.
*/ */
co_MsqPostKeyboardMessage(msg.message,msg.wParam,msg.lParam); co_MsqPostKeyboardMessage(msg.message, msg.wParam, msg.lParam);
} }
UserLeave(); UserLeave();
@ -1080,7 +1080,7 @@ NtUserBlockInput(
RETURN( IntBlockInput(PsGetCurrentThreadWin32Thread(), BlockIt)); RETURN( IntBlockInput(PsGetCurrentThreadWin32Thread(), BlockIt));
CLEANUP: CLEANUP:
TRACE("Leave NtUserBlockInput, ret=%i\n",_ret_); TRACE("Leave NtUserBlockInput, ret=%i\n", _ret_);
UserLeave(); UserLeave();
END_CLEANUP; END_CLEANUP;
} }
@ -1555,7 +1555,7 @@ NtUserSendInput(
RETURN( cnt); RETURN( cnt);
CLEANUP: CLEANUP:
TRACE("Leave NtUserSendInput, ret=%i\n",_ret_); TRACE("Leave NtUserSendInput, ret=%i\n", _ret_);
UserLeave(); UserLeave();
END_CLEANUP; END_CLEANUP;
} }
@ -1572,10 +1572,10 @@ IntQueryTrackMouseEvent(
pDesk = pti->rpdesk; pDesk = pti->rpdesk;
/* Always cleared with size set and return true. */ /* Always cleared with size set and return true. */
RtlZeroMemory(lpEventTrack ,sizeof(TRACKMOUSEEVENT)); RtlZeroMemory(lpEventTrack , sizeof(TRACKMOUSEEVENT));
lpEventTrack->cbSize = sizeof(TRACKMOUSEEVENT); lpEventTrack->cbSize = sizeof(TRACKMOUSEEVENT);
if ( pDesk->dwDTFlags & (DF_TME_LEAVE|DF_TME_HOVER) && if ( pDesk->dwDTFlags & (DF_TME_LEAVE | DF_TME_HOVER) &&
pDesk->spwndTrack && pDesk->spwndTrack &&
pti->MessageQueue == pDesk->spwndTrack->head.pti->MessageQueue ) pti->MessageQueue == pDesk->spwndTrack->head.pti->MessageQueue )
{ {
@ -1620,7 +1620,7 @@ IntTrackMouseEvent(
lpEventTrack->dwFlags & TME_NONCLIENT ? WM_NCMOUSELEAVE : WM_MOUSELEAVE, lpEventTrack->dwFlags & TME_NONCLIENT ? WM_NCMOUSELEAVE : WM_MOUSELEAVE,
0, 0); 0, 0);
} }
TRACE("IntTrackMouseEvent spwndTrack 0x%x pwnd 0x%x\n", pDesk->spwndTrack,pWnd); TRACE("IntTrackMouseEvent spwndTrack 0x%x pwnd 0x%x\n", pDesk->spwndTrack, pWnd);
return TRUE; return TRUE;
} }
@ -1696,7 +1696,7 @@ NtUserTrackMouseEvent(
goto Exit; goto Exit;
} }
if (saveTME.dwFlags & ~(TME_CANCEL|TME_QUERY|TME_NONCLIENT|TME_LEAVE|TME_HOVER) ) if (saveTME.dwFlags & ~(TME_CANCEL | TME_QUERY | TME_NONCLIENT | TME_LEAVE | TME_HOVER) )
{ {
EngSetLastError(ERROR_INVALID_FLAGS); EngSetLastError(ERROR_INVALID_FLAGS);
goto Exit; goto Exit;
@ -1723,7 +1723,7 @@ NtUserTrackMouseEvent(
} }
Exit: Exit:
TRACE("Leave NtUserTrackMouseEvent, ret=%i\n",Ret); TRACE("Leave NtUserTrackMouseEvent, ret=%i\n", Ret);
UserLeave(); UserLeave();
return Ret; return Ret;
} }
@ -1831,7 +1831,7 @@ NtUserGetMouseMovePointsEx(
RETURN( Count); RETURN( Count);
CLEANUP: CLEANUP:
TRACE("Leave NtUserGetMouseMovePointsEx, ret=%i\n",_ret_); TRACE("Leave NtUserGetMouseMovePointsEx, ret=%i\n", _ret_);
UserLeave(); UserLeave();
END_CLEANUP; END_CLEANUP;
} }

View file

@ -388,7 +388,7 @@ NtUserGetAsyncKeyState(
RETURN((SHORT)UserGetAsyncKeyState(key)); RETURN((SHORT)UserGetAsyncKeyState(key));
CLEANUP: CLEANUP:
TRACE("Leave NtUserGetAsyncKeyState, ret=%i\n",_ret_); TRACE("Leave NtUserGetAsyncKeyState, ret=%i\n", _ret_);
UserLeave(); UserLeave();
END_CLEANUP; END_CLEANUP;
} }
@ -641,7 +641,7 @@ NtUserMapVirtualKeyEx( UINT Code, UINT Type, DWORD keyboardId, HKL dwhkl )
RETURN(IntMapVirtualKeyEx( Code, Type, keyLayout )); RETURN(IntMapVirtualKeyEx( Code, Type, keyLayout ));
CLEANUP: CLEANUP:
TRACE("Leave NtUserMapVirtualKeyEx, ret=%i\n",_ret_); TRACE("Leave NtUserMapVirtualKeyEx, ret=%i\n", _ret_);
UserLeave(); UserLeave();
END_CLEANUP; END_CLEANUP;
} }
@ -684,7 +684,7 @@ NtUserToUnicodeEx(
/* Virtual code is correct? */ /* Virtual code is correct? */
if (wVirtKey < 0x100) if (wVirtKey < 0x100)
{ {
OutPwszBuff = ExAllocatePoolWithTag(NonPagedPool,sizeof(WCHAR) * cchBuff, TAG_STRING); OutPwszBuff = ExAllocatePoolWithTag(NonPagedPool, sizeof(WCHAR) * cchBuff, TAG_STRING);
if( !OutPwszBuff ) if( !OutPwszBuff )
{ {
ERR( "ExAllocatePoolWithTag(%d) failed\n", sizeof(WCHAR) * cchBuff); ERR( "ExAllocatePoolWithTag(%d) failed\n", sizeof(WCHAR) * cchBuff);
@ -701,14 +701,14 @@ NtUserToUnicodeEx(
wFlags, wFlags,
pti ? pti->KeyboardLayout->KBTables : 0 ); pti ? pti->KeyboardLayout->KBTables : 0 );
MmCopyToCaller(pwszBuff,OutPwszBuff,sizeof(WCHAR)*cchBuff); MmCopyToCaller(pwszBuff, OutPwszBuff, sizeof(WCHAR)*cchBuff);
ExFreePoolWithTag(OutPwszBuff, TAG_STRING); ExFreePoolWithTag(OutPwszBuff, TAG_STRING);
} }
RETURN(ret); RETURN(ret);
CLEANUP: CLEANUP:
TRACE("Leave NtUserSetKeyboardState, ret=%i\n",_ret_); TRACE("Leave NtUserSetKeyboardState, ret=%i\n", _ret_);
UserLeave(); UserLeave();
END_CLEANUP; END_CLEANUP;
} }
@ -730,7 +730,7 @@ NtUserGetKeyNameText( LONG lParam, LPWSTR lpString, int nSize )
UINT CareVk = 0; UINT CareVk = 0;
UINT VkCode = 0; UINT VkCode = 0;
UINT ScanCode = (lParam >> 16) & 0xff; UINT ScanCode = (lParam >> 16) & 0xff;
BOOL ExtKey = lParam & (1<<24) ? TRUE : FALSE; BOOL ExtKey = lParam & (1 << 24) ? TRUE : FALSE;
PKBDTABLES keyLayout; PKBDTABLES keyLayout;
VSC_LPWSTR *KeyNames; VSC_LPWSTR *KeyNames;
DECLARE_RETURN(DWORD); DECLARE_RETURN(DWORD);
@ -744,7 +744,7 @@ NtUserGetKeyNameText( LONG lParam, LPWSTR lpString, int nSize )
if( !keyLayout || nSize < 1 ) if( !keyLayout || nSize < 1 )
RETURN(0); RETURN(0);
if( lParam & (1<<25) ) if( lParam & (1 << 25) )
{ {
CareVk = VkCode = ScanToVk( ScanCode, ExtKey, keyLayout ); CareVk = VkCode = ScanToVk( ScanCode, ExtKey, keyLayout );
switch (VkCode) switch (VkCode)
@ -814,7 +814,7 @@ NtUserGetKeyNameText( LONG lParam, LPWSTR lpString, int nSize )
RETURN(ret); RETURN(ret);
CLEANUP: CLEANUP:
TRACE("Leave NtUserGetKeyNameText, ret=%i\n",_ret_); TRACE("Leave NtUserGetKeyNameText, ret=%i\n", _ret_);
UserLeave(); UserLeave();
END_CLEANUP; END_CLEANUP;
} }
@ -845,7 +845,8 @@ W32kKeyProcessMessage(LPMSG Msg,
{ VK_HOME, VK_NUMPAD7 }, { VK_HOME, VK_NUMPAD7 },
{ VK_UP, VK_NUMPAD8 }, { VK_UP, VK_NUMPAD8 },
{ VK_PRIOR, VK_NUMPAD9 }, { VK_PRIOR, VK_NUMPAD9 },
{ 0,0 } }; { 0, 0 }
};
PVSC_VK VscVkTable = NULL; PVSC_VK VscVkTable = NULL;
if( !KeyboardLayout || !Msg || if( !KeyboardLayout || !Msg ||
@ -857,14 +858,14 @@ W32kKeyProcessMessage(LPMSG Msg,
/* arty -- handle numpad -- On real windows, the actual key produced /* arty -- handle numpad -- On real windows, the actual key produced
* by the messaging layer is different based on the state of numlock. */ * by the messaging layer is different based on the state of numlock. */
ModifierBits = ModBits(KeyboardLayout,gKeyStateTable); ModifierBits = ModBits(KeyboardLayout, gKeyStateTable);
/* Get the raw scan code, so we can look up whether the key is a numpad /* Get the raw scan code, so we can look up whether the key is a numpad
* key * key
* *
* Shift and the LP_EXT_BIT cancel. */ * Shift and the LP_EXT_BIT cancel. */
ScanCode = (Msg->lParam >> 16) & 0xff; ScanCode = (Msg->lParam >> 16) & 0xff;
TRACE("ScanCode %04x\n",ScanCode); TRACE("ScanCode %04x\n", ScanCode);
BaseMapping = Msg->wParam = BaseMapping = Msg->wParam =
IntMapVirtualKeyEx( ScanCode, MAPVK_VSC_TO_VK, KeyboardLayout ); IntMapVirtualKeyEx( ScanCode, MAPVK_VSC_TO_VK, KeyboardLayout );
@ -1027,7 +1028,7 @@ NtUserVkKeyScanEx(
CapsMod = KeyLayout->pCharModifiers->ModNumber[CapsState]; CapsMod = KeyLayout->pCharModifiers->ModNumber[CapsState];
TRACE("nMod %d wC %04x: CapsMod %08x CapsState %08x MaxModBits %08x\n", TRACE("nMod %d wC %04x: CapsMod %08x CapsState %08x MaxModBits %08x\n",
nMod, wChar, CapsMod, CapsState, KeyLayout->pCharModifiers->wMaxModBits); nMod, wChar, CapsMod, CapsState, KeyLayout->pCharModifiers->wMaxModBits);
Ret = ((CapsMod << 8)|(vkPtr->VirtualKey & 0xff)); Ret = ((CapsMod << 8) | (vkPtr->VirtualKey & 0xff));
goto Exit; goto Exit;
} }
} }