capslock processing
This commit is contained in:
parent
1480073ac0
commit
6cd2bc0d67
|
@ -436,6 +436,15 @@ public:
|
||||||
|
|
||||||
bool composeReading = false;
|
bool composeReading = false;
|
||||||
|
|
||||||
|
// caps lock processing : if caps locked, temporarily disabled bopomofo.
|
||||||
|
if ([NSEvent modifierFlags] & NSAlphaShiftKeyMask){
|
||||||
|
if ([_composingBuffer length]) [self commitComposition:client];
|
||||||
|
if ([NSEvent modifierFlags] & NSShiftKeyMask) return NO;
|
||||||
|
NSString *popedText = [inputText lowercaseString];
|
||||||
|
[client insertText:popedText replacementRange:NSMakeRange(NSNotFound, NSNotFound)];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
// see if it's valid BPMF reading
|
// see if it's valid BPMF reading
|
||||||
if (_bpmfReadingBuffer->isValidKey((char)charCode)) {
|
if (_bpmfReadingBuffer->isValidKey((char)charCode)) {
|
||||||
_bpmfReadingBuffer->combineKey((char)charCode);
|
_bpmfReadingBuffer->combineKey((char)charCode);
|
||||||
|
@ -667,12 +676,12 @@ public:
|
||||||
// still nothing, then we update the composing buffer (some app has
|
// still nothing, then we update the composing buffer (some app has
|
||||||
// strange behavior if we don't do this, "thinking" the key is not
|
// strange behavior if we don't do this, "thinking" the key is not
|
||||||
// actually consumed)
|
// actually consumed)
|
||||||
if ([_composingBuffer length]) {
|
if ([_composingBuffer length]) {
|
||||||
[self beep];
|
[self beep];
|
||||||
[self updateClientComposingBuffer:client];
|
[self updateClientComposingBuffer:client];
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue