From f50591e5a1709d8bd35a8d525edeaa70eb7f8889 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Fri, 25 Mar 2022 17:49:33 +0800 Subject: [PATCH] ctlIME // Simplify "includeShift". --- Source/Modules/IMEModules/ctlInputMethod.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Modules/IMEModules/ctlInputMethod.swift b/Source/Modules/IMEModules/ctlInputMethod.swift index 6713f2dc..d2566dd6 100644 --- a/Source/Modules/IMEModules/ctlInputMethod.swift +++ b/Source/Modules/IMEModules/ctlInputMethod.swift @@ -195,13 +195,12 @@ class ctlInputMethod: IMKInputController { // 同時注意:必須將 event.type == .flagsChanged 放在最外圍、且在其結尾插入 return false, // 否則,每次處理這種判斷時都會觸發 NSInternalInconsistencyException。 if (mgrPrefs.functionKeyboardLayout != mgrPrefs.basisKeyboardLayout) && (event.type == .flagsChanged) { - let includeShift = mgrPrefs.functionKeyKeyboardLayoutOverrideIncludeShiftKey if (event.modifierFlags == .capsLock || event.modifierFlags.contains(.command) || event.modifierFlags.contains(.option) || event.modifierFlags.contains(.control) || event.modifierFlags.contains(.function) || - (event.modifierFlags.contains(.shift) && includeShift)) { + (event.modifierFlags.contains(.shift) && mgrPrefs.functionKeyKeyboardLayoutOverrideIncludeShiftKey)) { (client as? IMKTextInput)?.overrideKeyboard(withKeyboardNamed: mgrPrefs.functionKeyboardLayout) } else { (client as? IMKTextInput)?.overrideKeyboard(withKeyboardNamed: mgrPrefs.basisKeyboardLayout)