clean up changes for pull request
This commit is contained in:
parent
8024aa9ab1
commit
93d864ad6f
|
@ -167,7 +167,6 @@ attachThreadToForeground()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DWORD threadID = GetWindowThreadProcessId(window, NULL);
|
DWORD threadID = GetWindowThreadProcessId(window, NULL);
|
||||||
|
|
||||||
// skip if no change
|
// skip if no change
|
||||||
if (g_attachedThread != threadID) {
|
if (g_attachedThread != threadID) {
|
||||||
// detach from previous thread
|
// detach from previous thread
|
||||||
|
@ -196,6 +195,10 @@ static
|
||||||
void
|
void
|
||||||
keyboardGetState(BYTE keys[256], DWORD vkCode, bool kf_up)
|
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) {
|
if (vkCode < 0 || vkCode >= 256) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -495,7 +498,7 @@ static
|
||||||
bool
|
bool
|
||||||
keyboardHookHandler(WPARAM wParam, LPARAM lParam)
|
keyboardHookHandler(WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
bool attached = attachThreadToForeground();
|
attachThreadToForeground();
|
||||||
return doKeyboardHookHandler(wParam, lParam);
|
return doKeyboardHookHandler(wParam, lParam);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue