KeyHandler // Reenable upstream symbol menu when isOptionHold.
This commit is contained in:
parent
2e68df9db8
commit
e8e04b8109
|
@ -638,7 +638,8 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
// MARK: Punctuation list
|
// MARK: Punctuation list
|
||||||
if ([input isSymbolMenuPhysicalKey] && ![input isShiftHold])
|
if ([input isSymbolMenuPhysicalKey] && ![input isShiftHold])
|
||||||
{
|
{
|
||||||
|
if (![input isOptionHold])
|
||||||
|
{
|
||||||
// 得在這裡先 commit buffer,不然會導致「在摁 ESC 離開符號選單時會重複輸入上一次的組字區的內容」的不當行為。
|
// 得在這裡先 commit buffer,不然會導致「在摁 ESC 離開符號選單時會重複輸入上一次的組字區的內容」的不當行為。
|
||||||
// 於是這裡用「模擬一次 Enter 鍵的操作」使其代為執行這個 commit buffer 的動作。
|
// 於是這裡用「模擬一次 Enter 鍵的操作」使其代為執行這個 commit buffer 的動作。
|
||||||
[self _handleEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
[self _handleEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
||||||
|
@ -648,20 +649,27 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
useVerticalMode:input.useVerticalMode];
|
useVerticalMode:input.useVerticalMode];
|
||||||
stateCallback(symbolState);
|
stateCallback(symbolState);
|
||||||
return YES;
|
return YES;
|
||||||
// if (_languageModel->hasUnigramsForKey("_punctuation_list"))) {
|
}
|
||||||
// if (_bpmfReadingBuffer->isEmpty()) {
|
// 摁 Alt(Option) 的情況下,叫出小麥注音原版的符號選單。
|
||||||
// _builder->insertReadingAtCursor(string("_punctuation_list"));
|
else if (_languageModel->hasUnigramsForKey("_punctuation_list"))
|
||||||
// NSString *poppedText = [self _popOverflowComposingTextAndWalk];
|
{
|
||||||
// InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
if (_bpmfReadingBuffer->isEmpty())
|
||||||
// inputting.poppedText = poppedText;
|
{
|
||||||
// stateCallback(inputting);
|
_builder->insertReadingAtCursor(string("_punctuation_list"));
|
||||||
// InputStateChoosingCandidate *choosingCandidate = [self _buildCandidateState:inputting
|
NSString *poppedText = [self _popOverflowComposingTextAndWalk];
|
||||||
// useVerticalMode:input.useVerticalMode]; stateCallback(choosingCandidate);
|
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
||||||
// } else { // If there is still unfinished bpmf reading, ignore the punctuation
|
inputting.poppedText = poppedText;
|
||||||
// errorCallback();
|
stateCallback(inputting);
|
||||||
// }
|
InputStateChoosingCandidate *choosingCandidate = [self _buildCandidateState:inputting
|
||||||
// return YES;
|
useVerticalMode:input.useVerticalMode];
|
||||||
// }
|
stateCallback(choosingCandidate);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // If there is still unfinished bpmf reading, ignore the punctuation
|
||||||
|
errorCallback();
|
||||||
|
}
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Punctuation
|
// MARK: Punctuation
|
||||||
|
|
Loading…
Reference in New Issue