Fix incorrect unprintable ASCII handling (#139)
When Caps Lock is on and when the character code is not printable, we should simply reject handling such character instead of absorbing it and inserting the character to the client buffer--not all apps handle those insertions.
This commit is contained in:
parent
b2d622503b
commit
994645f5d9
|
@ -593,6 +593,11 @@ public:
|
|||
return NO;
|
||||
}
|
||||
|
||||
// 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)) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
// when shift is pressed, don't do further processing, since it outputs capital letter anyway.
|
||||
NSString *popedText = [inputText lowercaseString];
|
||||
[client insertText:popedText replacementRange:NSMakeRange(NSNotFound, NSNotFound)];
|
||||
|
|
Loading…
Reference in New Issue