KeyHandler // Re-enable upstream symbol menu.
- We changed the hotkey of libChewing-style symbol menu to Alt+` since it has serious compatibility issues with non-standard Cocoa apps like iTerm2, Microsoft Word 2019, WeChat, etc.
This commit is contained in:
parent
f718a87991
commit
30e734d0fa
|
@ -638,7 +638,31 @@ 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])
|
||||||
|
{
|
||||||
|
if (_languageModel->hasUnigramsForKey("_punctuation_list"))
|
||||||
|
{
|
||||||
|
if (_bpmfReadingBuffer->isEmpty())
|
||||||
|
{
|
||||||
|
_builder->insertReadingAtCursor(string("_punctuation_list"));
|
||||||
|
NSString *poppedText = [self _popOverflowComposingTextAndWalk];
|
||||||
|
InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
||||||
|
inputting.poppedText = poppedText;
|
||||||
|
stateCallback(inputting);
|
||||||
|
InputStateChoosingCandidate *choosingCandidate = [self _buildCandidateState:inputting
|
||||||
|
useVerticalMode:input.useVerticalMode];
|
||||||
|
stateCallback(choosingCandidate);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // If there is still unfinished bpmf reading, ignore the punctuation
|
||||||
|
[IME prtDebugIntel:@"17446655"];
|
||||||
|
errorCallback();
|
||||||
|
}
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// 得在這裡先 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 +672,7 @@ 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()) {
|
|
||||||
// _builder->insertReadingAtCursor(string("_punctuation_list"));
|
|
||||||
// NSString *poppedText = [self _popOverflowComposingTextAndWalk];
|
|
||||||
// InputStateInputting *inputting = (InputStateInputting *)[self buildInputtingState];
|
|
||||||
// inputting.poppedText = poppedText;
|
|
||||||
// stateCallback(inputting);
|
|
||||||
// InputStateChoosingCandidate *choosingCandidate = [self _buildCandidateState:inputting
|
|
||||||
// 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