diff --git a/Source/Modules/SessionCtl_HandleEvent.swift b/Source/Modules/SessionCtl_HandleEvent.swift index b45d36b1..41c0e099 100644 --- a/Source/Modules/SessionCtl_HandleEvent.swift +++ b/Source/Modules/SessionCtl_HandleEvent.swift @@ -122,9 +122,16 @@ public extension SessionCtl { eventToDeal = eventToDeal.convertFromEmacsKeyEvent(isVerticalContext: verticalProcessing) } - // 在啟用注音排列而非拼音輸入的情況下,強制將當前鍵盤佈局翻譯為美規鍵盤。 + // 在啟用注音排列而非拼音輸入的情況下,強制將當前鍵盤佈局翻譯為美規鍵盤(或指定的其它鍵盤佈局)。 if !inputHandler.isComposerUsingPinyin || IMKHelper.isDynamicBasicKeyboardLayoutEnabled { - eventToDeal = eventToDeal.layoutTranslated(to: .qwerty) + var defaultLayout = LatinKeyboardMarkings(rawValue: PrefMgr.shared.basicKeyboardLayout) ?? .qwerty + if let parser = KeyboardParser(rawValue: PrefMgr.shared.keyboardParser) { + switch parser { + case .ofStandard, .ofIBM, .ofSeigyou, .ofFakeSeigyou, .ofDachen26: defaultLayout = .qwerty + default: break + } + } + eventToDeal = eventToDeal.layoutTranslated(to: defaultLayout) } // Apple 數字小鍵盤處理