ctlIME // +resetModifierFlags with application.
This commit is contained in:
parent
163b3e46c7
commit
68ddca83e7
|
@ -83,6 +83,15 @@ class ctlInputMethod: IMKInputController {
|
||||||
IME.isFunction = event.modifierFlags.intersection(.deviceIndependentFlagsMask).contains(.function)
|
IME.isFunction = event.modifierFlags.intersection(.deviceIndependentFlagsMask).contains(.function)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func resetModifierFlags() {
|
||||||
|
IME.isShiftPressed = false
|
||||||
|
IME.isOptionPressed = false
|
||||||
|
IME.isCapsLockOn = false
|
||||||
|
IME.isCommandPressed = false
|
||||||
|
IME.isNumericPad = false
|
||||||
|
IME.isFunction = false
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - IMKInputController methods
|
// MARK: - IMKInputController methods
|
||||||
|
|
||||||
override init!(server: IMKServer!, delegate: Any!, client inputClient: Any!) {
|
override init!(server: IMKServer!, delegate: Any!, client inputClient: Any!) {
|
||||||
|
@ -217,7 +226,8 @@ class ctlInputMethod: IMKInputController {
|
||||||
}
|
}
|
||||||
|
|
||||||
override func handle(_ event: NSEvent!, client: Any!) -> Bool {
|
override func handle(_ event: NSEvent!, client: Any!) -> Bool {
|
||||||
// 更新全局共用狀態開關的參數。
|
//重設且更新全局共用狀態開關的參數。
|
||||||
|
resetModifierFlags()
|
||||||
updateModifierFlags(event)
|
updateModifierFlags(event)
|
||||||
|
|
||||||
if mgrPrefs.functionKeyboardLayout != mgrPrefs.basisKeyboardLayout {
|
if mgrPrefs.functionKeyboardLayout != mgrPrefs.basisKeyboardLayout {
|
||||||
|
|
Loading…
Reference in New Issue