From 9eb894d81d7bd327583eb88240edf520a676be88 Mon Sep 17 00:00:00 2001 From: Brian Hasden Date: Wed, 12 Aug 2026 14:42:34 -0400 Subject: [PATCH] Add Alt+Tab / Alt+Shift+Tab window-switching navigation actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows users expect Alt+Tab to cycle windows/apps. Add four new NavigationAction presets so this can be mapped without needing raw key-swap rules: Switch App (⌘Tab), Switch Window (⌘`), and their reverse (⇧⌘Tab / ⇧⌘`) counterparts for going back. Localized in all 14 supported languages. Co-Authored-By: Claude Sonnet 5 --- Sources/BC64Keys/BC64KeysApp.swift | 14 +++++++++++ Sources/BC64Keys/Localization.swift | 38 ++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/Sources/BC64Keys/BC64KeysApp.swift b/Sources/BC64Keys/BC64KeysApp.swift index f20e554..633524b 100644 --- a/Sources/BC64Keys/BC64KeysApp.swift +++ b/Sources/BC64Keys/BC64KeysApp.swift @@ -647,6 +647,14 @@ struct NavigationAction: Identifiable, Codable, Hashable { return "⌘N " + L10n.current.actionNewWindow } else if name.contains("New Tab") { return "⌘T " + L10n.current.actionNewTab + } else if name.contains("Switch App (Reverse)") { + return "⇧⌘Tab " + L10n.current.actionSwitchAppReverse + } else if name.contains("Switch Window (Reverse)") { + return "⇧⌘` " + L10n.current.actionSwitchWindowReverse + } else if name.contains("Switch App") { + return "⌘Tab " + L10n.current.actionSwitchApp + } else if name.contains("Switch Window") { + return "⌘` " + L10n.current.actionSwitchWindow } return name // Fallback to English name } @@ -735,6 +743,12 @@ extension NavigationAction { NavigationAction(name: "⌘Q Quit", key: 12, modifiers: .maskCommand), NavigationAction(name: "⌘N New Window/Document", key: 45, modifiers: .maskCommand), NavigationAction(name: "⌘T New Tab", key: 17, modifiers: .maskCommand), + + // === WINDOW SWITCHING (replaces Alt+Tab) === + NavigationAction(name: "⌘Tab Switch App", key: 48, modifiers: .maskCommand), + NavigationAction(name: "⌘` Switch Window", key: 50, modifiers: .maskCommand), + NavigationAction(name: "⇧⌘Tab Switch App (Reverse)", key: 48, modifiers: [.maskCommand, .maskShift]), + NavigationAction(name: "⇧⌘` Switch Window (Reverse)", key: 50, modifiers: [.maskCommand, .maskShift]), ] } diff --git a/Sources/BC64Keys/Localization.swift b/Sources/BC64Keys/Localization.swift index 73e764f..71cbf7e 100644 --- a/Sources/BC64Keys/Localization.swift +++ b/Sources/BC64Keys/Localization.swift @@ -708,7 +708,43 @@ class L10n: ObservableObject { "sv": "Ny flik", "pl": "Nowa karta", "ko": "새 탭", "tr": "Yeni sekme"]) } - + var actionSwitchApp: String { + tr(["en": "Switch App", "hu": "Alkalmazás váltása", + "de": "App wechseln", "fr": "Changer d'application", + "es": "Cambiar de aplicación", "it": "Cambia app", + "ja": "アプリを切り替え", "zh": "切换应用", + "nl": "Wisselen van app", "pt": "Alternar app", + "sv": "Växla app", "pl": "Przełącz aplikację", + "ko": "앱 전환", "tr": "Uygulama değiştir"]) + } + var actionSwitchWindow: String { + tr(["en": "Switch Window", "hu": "Ablak váltása", + "de": "Fenster wechseln", "fr": "Changer de fenêtre", + "es": "Cambiar de ventana", "it": "Cambia finestra", + "ja": "ウィンドウを切り替え", "zh": "切换窗口", + "nl": "Wisselen van venster", "pt": "Alternar janela", + "sv": "Växla fönster", "pl": "Przełącz okno", + "ko": "창 전환", "tr": "Pencere değiştir"]) + } + var actionSwitchAppReverse: String { + tr(["en": "Switch App (Reverse)", "hu": "Alkalmazás váltása (visszafelé)", + "de": "App wechseln (rückwärts)", "fr": "Changer d'application (arrière)", + "es": "Cambiar de aplicación (atrás)", "it": "Cambia app (indietro)", + "ja": "アプリを切り替え(逆方向)", "zh": "切换应用(反向)", + "nl": "Wisselen van app (achteruit)", "pt": "Alternar app (reverso)", + "sv": "Växla app (bakåt)", "pl": "Przełącz aplikację (odwrotnie)", + "ko": "앱 전환(역방향)", "tr": "Uygulama değiştir (ters)"]) + } + var actionSwitchWindowReverse: String { + tr(["en": "Switch Window (Reverse)", "hu": "Ablak váltása (visszafelé)", + "de": "Fenster wechseln (rückwärts)", "fr": "Changer de fenêtre (arrière)", + "es": "Cambiar de ventana (atrás)", "it": "Cambia finestra (indietro)", + "ja": "ウィンドウを切り替え(逆方向)", "zh": "切换窗口(反向)", + "nl": "Wisselen van venster (achteruit)", "pt": "Alternar janela (reverso)", + "sv": "Växla fönster (bakåt)", "pl": "Przełącz okno (odwrotnie)", + "ko": "창 전환(역방향)", "tr": "Pencere değiştir (ters)"]) + } + // MARK: - Visual Keyboard var visualKeyboard: String { tr(["en": "Visual Keyboard", "hu": "Vizuális billentyűzet",