Skip to content

Commit

Permalink
simplify the condiction
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Sep 11, 2024
1 parent c380242 commit 6b97bff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions WeaselTSF/KeyEventSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ static BOOL prevfEaten = FALSE;
static int keyCountToSimulate = 0;

void WeaselTSF::_ProcessKeyEvent(WPARAM wParam, LPARAM lParam, BOOL* pfEaten) {
if (_isToOpenClose && (!_IsKeyboardOpen() || _IsKeyboardDisabled())) {
*pfEaten = FALSE;
return;
} else if (!_isToOpenClose && _IsKeyboardDisabled()) {
// when _IsKeyboardDisabled don't eat the key,
// when keyboard closable and keyboard closed, don't eat the key
if ((_isToOpenClose && !_IsKeyboardOpen()) || _IsKeyboardDisabled()) {
*pfEaten = FALSE;
return;
}
Expand Down

0 comments on commit 6b97bff

Please sign in to comment.