clean up changes for pull request

This commit is contained in:
chris 2014-11-04 12:13:57 -05:00 committed by chris
parent 8024aa9ab1
commit 93d864ad6f
1 changed files with 6 additions and 3 deletions

View File

@ -167,7 +167,6 @@ attachThreadToForeground()
return false;
DWORD threadID = GetWindowThreadProcessId(window, NULL);
// skip if no change
if (g_attachedThread != threadID) {
// detach from previous thread
@ -196,6 +195,10 @@ static
void
keyboardGetState(BYTE keys[256], DWORD vkCode, bool kf_up)
{
// we have to use GetAsyncKeyState() rather than GetKeyState() because
// we don't pass through most keys so the event synchronous state
// doesn't get updated. we do that because certain modifier keys have
// side effects, like alt and the windows key.
if (vkCode < 0 || vkCode >= 256) {
return;
}
@ -495,7 +498,7 @@ static
bool
keyboardHookHandler(WPARAM wParam, LPARAM lParam)
{
bool attached = attachThreadToForeground();
attachThreadToForeground();
return doKeyboardHookHandler(wParam, lParam);
}
#endif