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
2520c61662
commit
f300c5a4e5
|
@ -491,7 +491,9 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
// MARK: Enter
|
// MARK: Enter
|
||||||
if (charCode == 13) {
|
if (charCode == 13) {
|
||||||
if ([input isControlHold]) {
|
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];
|
return [self _handleEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,6 +185,12 @@ class ctlInputMethod: IMKInputController {
|
||||||
var textFrame = NSRect.zero
|
var textFrame = NSRect.zero
|
||||||
let attributes: [AnyHashable: Any]? = (client as? IMKTextInput)?.attributes(forCharacterIndex: 0, lineHeightRectangle: &textFrame)
|
let attributes: [AnyHashable: Any]? = (client as? IMKTextInput)?.attributes(forCharacterIndex: 0, lineHeightRectangle: &textFrame)
|
||||||
let useVerticalMode = (attributes?["IMKTextOrientation"] as? NSNumber)?.intValue == 0 || false
|
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)
|
let input = KeyHandlerInput(event: event, isVerticalMode: useVerticalMode)
|
||||||
|
|
||||||
|
@ -554,6 +560,12 @@ extension ctlInputMethod {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - 開關判定當前應用究竟是?
|
||||||
|
|
||||||
|
@objc extension ctlInputMethod {
|
||||||
|
@objc static var areWeUsingOurOwnPhraseEditor: Bool = false
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: -
|
// MARK: -
|
||||||
|
|
||||||
extension ctlInputMethod: KeyHandlerDelegate {
|
extension ctlInputMethod: KeyHandlerDelegate {
|
||||||
|
|
Loading…
Reference in New Issue