Adds symbols.
This commit is contained in:
parent
153064ae9f
commit
f32689eede
|
@ -479,6 +479,9 @@ static NSString *const kGraphVizOutputfile = @"/tmp/McBopomofo-visualization.dot
|
||||||
|
|
||||||
// MARK: Enter
|
// MARK: Enter
|
||||||
if (charCode == 13) {
|
if (charCode == 13) {
|
||||||
|
if ([input isControlHold]) {
|
||||||
|
return [self _handleCtrlEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
||||||
|
}
|
||||||
return [self _handleEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
return [self _handleEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -773,21 +776,30 @@ static NSString *const kGraphVizOutputfile = @"/tmp/McBopomofo-visualization.dot
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)_handleEnterWithState:(InputState *)state stateCallback:(void (^)(InputState *))stateCallback errorCallback:(void (^)(void))errorCallback
|
- (BOOL)_handleCtrlEnterWithState:(InputState *)state stateCallback:(void (^)(InputState *))stateCallback errorCallback:(void (^)(void))errorCallback
|
||||||
{
|
{
|
||||||
if (![state isKindOfClass:[InputStateInputting class]]) {
|
if (![state isKindOfClass:[InputStateInputting class]]) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actually the lines would not be reached. When there is BMPF reading and
|
NSArray *readings = [self _currentReadings];
|
||||||
// a user input enter, we just send the readings to the client app.
|
NSString *composingBuffer = [readings componentsJoinedByString:@"-"];
|
||||||
|
|
||||||
// if (_inputMode == InputModePlainBopomofo) {
|
[self clear];
|
||||||
// if (!_bpmfReadingBuffer->isEmpty()) {
|
|
||||||
// errorCallback();
|
InputStateCommitting *committing = [[InputStateCommitting alloc] initWithPoppedText:composingBuffer];
|
||||||
// }
|
stateCallback(committing);
|
||||||
// return YES;
|
InputStateEmpty *empty = [[InputStateEmpty alloc] init];
|
||||||
// }
|
stateCallback(empty);
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (BOOL)_handleEnterWithState:(InputState *)state stateCallback:(void (^)(InputState *))stateCallback errorCallback:(void (^)(void))errorCallback
|
||||||
|
{
|
||||||
|
if (![state isKindOfClass:[InputStateInputting class]]) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
[self clear];
|
[self clear];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue