ctlIME // Make "areWeDeleting" available for all keyLayouts.

This commit is contained in:
ShikiSuen 2022-03-25 18:12:13 +08:00
parent e229fb49bf
commit 8270a3a41e
1 changed files with 3 additions and 2 deletions

View File

@ -205,11 +205,12 @@ class ctlInputMethod: IMKInputController {
} else { } else {
(client as? IMKTextInput)?.overrideKeyboard(withKeyboardNamed: mgrPrefs.basisKeyboardLayout) (client as? IMKTextInput)?.overrideKeyboard(withKeyboardNamed: mgrPrefs.basisKeyboardLayout)
} }
// Enter
ctlInputMethod.areWeDeleting = event.modifierFlags.contains([.shift, .command])
return false return false
} }
// Enter
ctlInputMethod.areWeDeleting = event.modifierFlags.contains([.shift, .command])
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