KeyHandler // Always return NO when ↓Shift & +CapsLock.

This commit is contained in:
ShikiSuen 2022-03-11 13:49:32 +08:00
parent 6d585d4ab1
commit be1c934eff
1 changed files with 3 additions and 7 deletions

View File

@ -286,14 +286,10 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
InputStateEmpty *emptyState = [[InputStateEmpty alloc] init]; InputStateEmpty *emptyState = [[InputStateEmpty alloc] init];
stateCallback(emptyState); stateCallback(emptyState);
// Non-Dynamic Keyboard Layouts Only: When shift is pressed, don't do further processing, since it outputs capital letter anyway. // When shift is pressed, don't do further processing, since it outputs capital letter anyway.
if ((![Preferences.basisKeyboardLayout isEqual: @"com.apple.keylayout.ZhuyinBopomofo"]
&& ![Preferences.basisKeyboardLayout isEqual: @"com.apple.keylayout.ZhuyinEten"])
|| [input isCapsLockOn]){
if ([input isShiftHold]) { if ([input isShiftHold]) {
return NO; return NO;
} }
}
// if ASCII but not printable, don't use insertText:replacementRange: as many apps don't handle non-ASCII char insertions. // if ASCII but not printable, don't use insertText:replacementRange: as many apps don't handle non-ASCII char insertions.
if (charCode < 0x80 && !isprint(charCode)) { if (charCode < 0x80 && !isprint(charCode)) {