IME // Disable BPMF-Commit except typing into our user phrase editor.
- Otherwise, it may disturb user experiences in usual cases.
This commit is contained in:
parent
50f0d27209
commit
ee31712cfe
|
@ -491,7 +491,9 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
|||
// MARK: Enter
|
||||
if (charCode == 13) {
|
||||
if ([input isControlHold]) {
|
||||
return [self _handleCtrlEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
||||
if (ctlInputMethod.areWeUsingOurOwnPhraseEditor) {
|
||||
return [self _handleCtrlEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
||||
}
|
||||
}
|
||||
return [self _handleEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
||||
}
|
||||
|
|
|
@ -185,6 +185,12 @@ class ctlInputMethod: IMKInputController {
|
|||
var textFrame = NSRect.zero
|
||||
let attributes: [AnyHashable: Any]? = (client as? IMKTextInput)?.attributes(forCharacterIndex: 0, lineHeightRectangle: &textFrame)
|
||||
let useVerticalMode = (attributes?["IMKTextOrientation"] as? NSNumber)?.intValue == 0 || false
|
||||
|
||||
if (client as? IMKTextInput)?.bundleIdentifier() == "org.atelierInmu.vChewing.vChewingPhraseEditor" {
|
||||
ctlInputMethod.areWeUsingOurOwnPhraseEditor = true
|
||||
} else {
|
||||
ctlInputMethod.areWeUsingOurOwnPhraseEditor = false
|
||||
}
|
||||
|
||||
let input = KeyHandlerInput(event: event, isVerticalMode: useVerticalMode)
|
||||
|
||||
|
@ -554,6 +560,12 @@ extension ctlInputMethod {
|
|||
}
|
||||
}
|
||||
|
||||
// MARK: - 開關判定當前應用究竟是?
|
||||
|
||||
@objc extension ctlInputMethod {
|
||||
@objc static var areWeUsingOurOwnPhraseEditor: Bool = false
|
||||
}
|
||||
|
||||
// MARK: -
|
||||
|
||||
extension ctlInputMethod: KeyHandlerDelegate {
|
||||
|
|
Loading…
Reference in New Issue