Skip to content

Commit

Permalink
Add missing GetKeyboardState check
Browse files Browse the repository at this point in the history
  • Loading branch information
taviso committed May 16, 2017
1 parent cb75dfc commit 56952e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hotcorner.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ static DWORD WINAPI CornerHotFunc(LPVOID lpParameter)
}

// Check if any modifier keys are pressed.
if (KEYDOWN(KeyState[VK_SHIFT]) || KEYDOWN(KeyState[VK_CONTROL])
|| KEYDOWN(KeyState[VK_MENU]) || KEYDOWN(KeyState[VK_LWIN])
|| KEYDOWN(KeyState[VK_RWIN])) {
return 0;
if (GetKeyboardState(KeyState)) {
if (KEYDOWN(KeyState[VK_SHIFT]) || KEYDOWN(KeyState[VK_CONTROL])
|| KEYDOWN(KeyState[VK_MENU]) || KEYDOWN(KeyState[VK_LWIN])
|| KEYDOWN(KeyState[VK_RWIN])) {
return 0;
}
}

// Verify the corner is still hot
Expand Down

0 comments on commit 56952e6

Please sign in to comment.