Skip to content

Commit

Permalink
Update SquirrelInputController.m
Browse files Browse the repository at this point in the history
  • Loading branch information
groverlynn committed May 15, 2023
1 parent 524b96e commit 4e21227
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions SquirrelInputController.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,21 @@ - (BOOL)handleEvent:(NSEvent*)event client:(id)sender
[self processKey:rime_keycode modifiers:rime_modifiers];
}
if (changes & OSX_SHIFT_MASK) {
release_mask = modifiers & OSX_SHIFT_MASK ? 0 : kReleaseMask | (eventCount - _lastEventCount == 1 ? 0 : kIgnoredMask);
release_mask = modifiers & OSX_SHIFT_MASK ? 0 : kReleaseMask | (eventCount - _lastEventCount <= 1 ? 0 : kIgnoredMask);
[self processKey:rime_keycode modifiers:(rime_modifiers | release_mask)];
}
if (changes & OSX_CTRL_MASK) {
release_mask = modifiers & OSX_CTRL_MASK ? 0 : kReleaseMask | (eventCount - _lastEventCount == 1 ? 0 : kIgnoredMask);
release_mask = modifiers & OSX_CTRL_MASK ? 0 : kReleaseMask | (eventCount - _lastEventCount <= 1 ? 0 : kIgnoredMask);
[self processKey:rime_keycode modifiers:(rime_modifiers | release_mask)];
}
if (changes & OSX_ALT_MASK) {
release_mask = modifiers & OSX_ALT_MASK ? 0 : kReleaseMask | (eventCount - _lastEventCount == 1 ? 0 : kIgnoredMask);
release_mask = modifiers & OSX_ALT_MASK ? 0 : kReleaseMask | (eventCount - _lastEventCount <= 1 ? 0 : kIgnoredMask);
[self processKey:rime_keycode modifiers:(rime_modifiers | release_mask)];
}
if (changes & OSX_COMMAND_MASK) {
release_mask = modifiers & OSX_COMMAND_MASK ? 0 : kReleaseMask | (eventCount - _lastEventCount == 1 ? 0 : kIgnoredMask);
release_mask = modifiers & OSX_COMMAND_MASK ? 0 : kReleaseMask | (eventCount - _lastEventCount <= 1 ? 0 : kIgnoredMask);
[self processKey:rime_keycode modifiers:(rime_modifiers | release_mask)];
_lastEventCount = eventCount;
// do not update UI when using Command key
break;
}
Expand Down

0 comments on commit 4e21227

Please sign in to comment.