KeyHandler // Enable bpmf commit with Ctrl+CMD+Enter.
- In UserPhraseEditor the hotkey is Ctrl+Enter, committing bpmf readings with separator "-". - In other apps the hotkey is Ctrl+CMD+Enter, committing bpmf readings with an ASCII space as the separator.
This commit is contained in:
parent
dd0aa14509
commit
e05278c53e
|
@ -524,7 +524,7 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
// MARK: Enter
|
// MARK: Enter
|
||||||
if ([input isEnter]) {
|
if ([input isEnter]) {
|
||||||
if ([input isControlHold]) {
|
if ([input isControlHold]) {
|
||||||
if (ctlInputMethod.areWeUsingOurOwnPhraseEditor) {
|
if (ctlInputMethod.areWeUsingOurOwnPhraseEditor || [input isCommandHold]) {
|
||||||
return [self _handleCtrlEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
return [self _handleCtrlEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -850,12 +850,10 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
|
|
||||||
- (BOOL)_handleCtrlEnterWithState:(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;
|
|
||||||
}
|
|
||||||
|
|
||||||
NSArray *readings = [self _currentReadings];
|
NSArray *readings = [self _currentReadings];
|
||||||
NSString *composingBuffer = [readings componentsJoinedByString:@"-"];
|
NSString *composingBuffer = (ctlInputMethod.areWeUsingOurOwnPhraseEditor) ? [readings componentsJoinedByString:@"-"] : [readings componentsJoinedByString:@" "] ;
|
||||||
|
|
||||||
[self clear];
|
[self clear];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue