diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ad52a9..38d0a59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ What's new in each version of Glide for Mac. Glide shows the new entries once after it updates, and each release's notes on GitHub come from here, so write for people using Glide. Add an entry for every change worth knowing about under the next version before tagging it. Glide shows these notes in the app's language: the translations live in `changelog/CHANGELOG..md`, and a new entry must be translated in every one of them before tagging (`ChangelogTranslationTests` checks that they match this file). +## 0.11.2 — 2026-10-30 + +### New + +- **Use ⌥ alone as the Glide modifier.** Settings › Shortcuts › Glide modifier switches every default shortcut from ⌃⌥ to ⌥, as AeroSpace and similar apps do: ⌥→ focuses right, ⌥⇧→ moves the window, and ⌥ + wheel glides the strip. ⌥ + arrows then stop jumping by word in text, and ⌥ + letters and digits stop typing characters like é or ©. Shortcuts you changed yourself stay as they are. + ## 0.11.1 — 2026-10-20 ### Changes diff --git a/Glide.xcodeproj/project.pbxproj b/Glide.xcodeproj/project.pbxproj index 65d035e..1c4398e 100644 --- a/Glide.xcodeproj/project.pbxproj +++ b/Glide.xcodeproj/project.pbxproj @@ -640,7 +640,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 16; + CURRENT_PROJECT_VERSION = 17; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 435MC3786D; ENABLE_HARDENED_RUNTIME = YES; @@ -662,7 +662,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MACOSX_DEPLOYMENT_TARGET = 27.0; - MARKETING_VERSION = 0.11.1; + MARKETING_VERSION = 0.11.2; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -712,7 +712,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 16; + CURRENT_PROJECT_VERSION = 17; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 435MC3786D; ENABLE_HARDENED_RUNTIME = YES; @@ -728,7 +728,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MACOSX_DEPLOYMENT_TARGET = 27.0; - MARKETING_VERSION = 0.11.1; + MARKETING_VERSION = 0.11.2; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/README.md b/README.md index e78999a..fac753f 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ Raw finger positions come from Apple's private MultitouchSupport framework, the ## Changing shortcuts +**Settings › Shortcuts › Glide modifier** switches every default from ⌃⌥ to ⌥ alone, as AeroSpace and similar apps use (⌥→ focuses right, ⌥⇧→ moves, ⌥⌘→ goes to the next display, and the mouse wheel follows too). It's easier to press, but ⌥ + arrows then stop jumping by word in text fields, and ⌥ + letters and digits stop typing characters like é, ñ or ©. Shortcuts you changed by hand stay as they are, and win over a new default on the same keys. The choice is saved under the `glideModifier` key. + Open **Settings…** from the menu bar icon, click a shortcut and press the new combo. Esc cancels; ⌫ removes the shortcut. Shortcuts must include ⌃, ⌥ or ⌘ (F-keys may stand alone). Glide warns when a combo would shadow a text-editing or macOS shortcut. Assigning a combo that another Glide action uses moves it. Shortcuts are saved in `UserDefaults` (`dev.quackbyte.glide`, key `shortcuts`, overrides only), and **Restore Defaults** clears them. If a shortcut can't be registered, the menu bar icon turns into a warning triangle. The menu and the Settings row then name the shortcut and the reason. macOS has no public API to see every other app's shortcuts: Glide detects collisions with enabled macOS shortcuts, but not with an app that grabs keys through an event tap or registers the same combo after Glide starts. diff --git a/Sources/Glide/GlideApp.swift b/Sources/Glide/GlideApp.swift index 2bedfa2..16c59a3 100644 --- a/Sources/Glide/GlideApp.swift +++ b/Sources/Glide/GlideApp.swift @@ -310,10 +310,11 @@ final class AppController { private func handleWheel(_ tick: WheelTick) -> Bool { guard windowManager.isEnabled else { return false } - // A full-screen video or game keeps its wheel; ⌃⌥ is asked for, so it still goes to the strip. - if windowManager.gesturesPassThrough, !tick.chordHeld { return false } + // A full-screen video or game keeps its wheel; the Glide modifier is asked for, so it still goes to the strip. + let chordHeld = tick.modifiers.isSuperset(of: shortcuts.modifier.modifiers) + if windowManager.gesturesPassThrough, !chordHeld { return false } let mode = horizontalWheelMode - guard WheelRouting.movesStrip(horizontal: tick.horizontal, chordHeld: tick.chordHeld, mode: mode) else { return false } + guard WheelRouting.movesStrip(horizontal: tick.horizontal, chordHeld: chordHeld, mode: mode) else { return false } windowManager.scrollWheel(notches: tick.notches) return true } diff --git a/Sources/Glide/Localizable.xcstrings b/Sources/Glide/Localizable.xcstrings index 44b9621..d670f5c 100644 --- a/Sources/Glide/Localizable.xcstrings +++ b/Sources/Glide/Localizable.xcstrings @@ -2387,6 +2387,100 @@ } } }, + "Every default shortcut uses ⌃⌥, and ⇧ to move windows. Shortcuts you changed stay as they are." : { + "extractionState" : "manual", + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Alle Standard-Tastenkürzel verwenden ⌃⌥, mit ⇧ zum Bewegen von Fenstern. Tastenkürzel, die du geändert hast, bleiben unverändert." + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Todos los atajos predeterminados usan ⌃⌥, y ⇧ para mover ventanas. Los atajos que hayas cambiado se quedan como están." + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tous les raccourcis par défaut utilisent ⌃⌥, et ⇧ pour déplacer les fenêtres. Les raccourcis que vous avez modifiés restent tels quels." + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "すべての標準ショートカットで⌃⌥を使い、ウインドウの移動には⇧を加えます。変更したショートカットはそのまま残ります。" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "모든 기본 단축키는 ⌃⌥를 사용하며, 윈도우를 이동할 때는 ⇧를 함께 누릅니다. 변경한 단축키는 그대로 유지됩니다." + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Todos os atalhos padrão usam ⌃⌥, e ⇧ para mover janelas. Os atalhos que você mudou continuam como estão." + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "所有默认快捷键都使用 ⌃⌥,加 ⇧ 可移动窗口。你更改过的快捷键保持不变。" + } + } + } + }, + "Every default shortcut uses ⌥, and ⇧ to move windows. ⌥ + arrows no longer jump by word in text, and ⌥ + letters and digits no longer type special characters like é or ©. Shortcuts you changed stay as they are." : { + "extractionState" : "manual", + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Alle Standard-Tastenkürzel verwenden ⌥, mit ⇧ zum Bewegen von Fenstern. ⌥ + Pfeiltasten springen in Text nicht mehr wortweise, und ⌥ + Buchstaben und Ziffern tippen keine Sonderzeichen wie é oder © mehr. Tastenkürzel, die du geändert hast, bleiben unverändert." + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Todos los atajos predeterminados usan ⌥, y ⇧ para mover ventanas. ⌥ + flechas ya no saltan de palabra en palabra en el texto, y ⌥ + letras y números ya no escriben caracteres especiales como é o ©. Los atajos que hayas cambiado se quedan como están." + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tous les raccourcis par défaut utilisent ⌥, et ⇧ pour déplacer les fenêtres. ⌥ + flèches ne sautent plus de mot en mot dans le texte, et ⌥ + lettres et chiffres ne tapent plus de caractères spéciaux comme é ou ©. Les raccourcis que vous avez modifiés restent tels quels." + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "すべての標準ショートカットで⌥を使い、ウインドウの移動には⇧を加えます。テキスト内で⌥+矢印キーによる単語単位の移動ができなくなり、⌥+文字や数字でéや©などの特殊文字を入力できなくなります。変更したショートカットはそのまま残ります。" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "모든 기본 단축키는 ⌥를 사용하며, 윈도우를 이동할 때는 ⇧를 함께 누릅니다. 텍스트에서 ⌥ + 화살표로 단어 단위 이동을 할 수 없게 되고, ⌥ + 문자나 숫자로 é나 © 같은 특수 문자를 입력할 수 없게 됩니다. 변경한 단축키는 그대로 유지됩니다." + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Todos os atalhos padrão usam ⌥, e ⇧ para mover janelas. ⌥ + setas deixam de pular de palavra em palavra no texto, e ⌥ + letras e números deixam de digitar caracteres especiais como é ou ©. Os atalhos que você mudou continuam como estão." + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "所有默认快捷键都使用 ⌥,加 ⇧ 可移动窗口。⌥ + 箭头键将不再在文本中按单词跳转,⌥ + 字母和数字也将不再输入 é 或 © 等特殊字符。你更改过的快捷键保持不变。" + } + } + } + }, "Filter" : { "extractionState" : "manual", "localizations" : { @@ -2716,6 +2810,53 @@ } } }, + "Glide modifier" : { + "extractionState" : "manual", + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Glide-Modifikatortaste" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tecla modificadora de Glide" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Touche de modification de Glide" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "Glideの修飾キー" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "Glide 보조 키" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tecla modificadora do Glide" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "Glide 修饰键" + } + } + } + }, "Glide Settings" : { "extractionState" : "manual", "localizations" : { @@ -4361,49 +4502,49 @@ } } }, - "Rules apply as windows open. Float and tile take effect right away; width and workspace apply to new windows. ⌃⌥V still floats or tiles a single window." : { + "Rules apply as windows open. Float and tile take effect right away; width and workspace apply to new windows. %@ still floats or tiles a single window." : { "extractionState" : "manual", "localizations" : { "de" : { "stringUnit" : { "state" : "translated", - "value" : "Regeln gelten, sobald Fenster geöffnet werden. Schweben und Kacheln wirken sofort; Breite und Arbeitsbereich gelten für neue Fenster. Mit ⌃⌥V lässt sich weiterhin ein einzelnes Fenster schweben lassen oder kacheln." + "value" : "Regeln gelten, sobald Fenster geöffnet werden. Schweben und Kacheln wirken sofort; Breite und Arbeitsbereich gelten für neue Fenster. Mit %@ lässt sich weiterhin ein einzelnes Fenster schweben lassen oder kacheln." } }, "es" : { "stringUnit" : { "state" : "translated", - "value" : "Las reglas se aplican al abrirse las ventanas. Flotante y mosaico surten efecto al momento; el ancho y el escritorio se aplican a las ventanas nuevas. ⌃⌥V sigue haciendo flotar o poniendo en mosaico una sola ventana." + "value" : "Las reglas se aplican al abrirse las ventanas. Flotante y mosaico surten efecto al momento; el ancho y el escritorio se aplican a las ventanas nuevas. %@ sigue haciendo flotar o poniendo en mosaico una sola ventana." } }, "fr" : { "stringUnit" : { "state" : "translated", - "value" : "Les règles s’appliquent à l’ouverture des fenêtres. Flottante et mosaïque prennent effet immédiatement ; la largeur et le bureau s’appliquent aux nouvelles fenêtres. ⌃⌥V permet toujours de mettre une seule fenêtre en flottant ou en mosaïque." + "value" : "Les règles s’appliquent à l’ouverture des fenêtres. Flottante et mosaïque prennent effet immédiatement ; la largeur et le bureau s’appliquent aux nouvelles fenêtres. %@ permet toujours de mettre une seule fenêtre en flottant ou en mosaïque." } }, "ja" : { "stringUnit" : { "state" : "translated", - "value" : "ルールはウインドウを開いたときに適用されます。フローティングとタイル表示はすぐに反映され、幅とワークスペースは新しいウインドウに適用されます。⌃⌥Vで個別のウインドウをフローティングにしたり、タイル表示に戻したりすることもできます。" + "value" : "ルールはウインドウを開いたときに適用されます。フローティングとタイル表示はすぐに反映され、幅とワークスペースは新しいウインドウに適用されます。%@で個別のウインドウをフローティングにしたり、タイル表示に戻したりすることもできます。" } }, "ko" : { "stringUnit" : { "state" : "translated", - "value" : "규칙은 윈도우가 열릴 때 적용됩니다. 플로팅과 타일링은 즉시 적용되며, 너비와 워크스페이스는 새 윈도우에 적용됩니다. ⌃⌥V로는 여전히 윈도우 하나를 플로팅하거나 타일링할 수 있습니다." + "value" : "규칙은 윈도우가 열릴 때 적용됩니다. 플로팅과 타일링은 즉시 적용되며, 너비와 워크스페이스는 새 윈도우에 적용됩니다. %@로는 여전히 윈도우 하나를 플로팅하거나 타일링할 수 있습니다." } }, "pt-BR" : { "stringUnit" : { "state" : "translated", - "value" : "As regras são aplicadas quando as janelas abrem. Flutuante e mosaico valem na hora; largura e espaço de trabalho valem para as janelas novas. ⌃⌥V continua alternando uma única janela entre flutuante e mosaico." + "value" : "As regras são aplicadas quando as janelas abrem. Flutuante e mosaico valem na hora; largura e espaço de trabalho valem para as janelas novas. %@ continua alternando uma única janela entre flutuante e mosaico." } }, "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "规则会在窗口打开时应用。浮动和平铺会立即生效;宽度和工作区适用于新窗口。⌃⌥V 仍可让单个窗口浮动或平铺。" + "value" : "规则会在窗口打开时应用。浮动和平铺会立即生效;宽度和工作区适用于新窗口。%@ 仍可让单个窗口浮动或平铺。" } } } @@ -5019,49 +5160,49 @@ } } }, - "Tilting the mouse wheel (or a thumb wheel) glides the strip. ⌃⌥ with the wheel always does, whatever this is set to." : { + "Tilting the mouse wheel (or a thumb wheel) glides the strip. %@ with the wheel always does, whatever this is set to." : { "extractionState" : "manual", "localizations" : { "de" : { "stringUnit" : { "state" : "translated", - "value" : "Das seitliche Kippen des Mausrads (oder ein Daumenrad) bewegt das Band. ⌃⌥ mit dem Mausrad tut das immer, unabhängig von dieser Einstellung." + "value" : "Das seitliche Kippen des Mausrads (oder ein Daumenrad) bewegt das Band. %@ mit dem Mausrad tut das immer, unabhängig von dieser Einstellung." } }, "es" : { "stringUnit" : { "state" : "translated", - "value" : "Inclinar la rueda del ratón (o una rueda para el pulgar) recorre la tira. ⌃⌥ con la rueda siempre lo hace, sea cual sea este ajuste." + "value" : "Inclinar la rueda del ratón (o una rueda para el pulgar) recorre la tira. %@ con la rueda siempre lo hace, sea cual sea este ajuste." } }, "fr" : { "stringUnit" : { "state" : "translated", - "value" : "Incliner la molette de la souris (ou utiliser une molette pour le pouce) fait glisser la bande. ⌃⌥ avec la molette le fait toujours, quel que soit ce réglage." + "value" : "Incliner la molette de la souris (ou utiliser une molette pour le pouce) fait glisser la bande. %@ avec la molette le fait toujours, quel que soit ce réglage." } }, "ja" : { "stringUnit" : { "state" : "translated", - "value" : "マウスのホイール(または親指ホイール)を左右に倒すと、ストリップが滑らかに動きます。この設定にかかわらず、⌃⌥を押しながらホイールを回しても動かせます。" + "value" : "マウスのホイール(または親指ホイール)を左右に倒すと、ストリップが滑らかに動きます。この設定にかかわらず、%@を押しながらホイールを回しても動かせます。" } }, "ko" : { "stringUnit" : { "state" : "translated", - "value" : "마우스 휠(또는 엄지 휠)을 좌우로 기울이면 스트립이 이동합니다. 이 설정과 관계없이 ⌃⌥와 휠을 함께 사용하면 항상 이동합니다." + "value" : "마우스 휠(또는 엄지 휠)을 좌우로 기울이면 스트립이 이동합니다. 이 설정과 관계없이 %@와 휠을 함께 사용하면 항상 이동합니다." } }, "pt-BR" : { "stringUnit" : { "state" : "translated", - "value" : "Inclinar a roda do mouse (ou uma roda para o polegar) desliza a faixa. ⌃⌥ com a roda sempre faz isso, qualquer que seja este ajuste." + "value" : "Inclinar a roda do mouse (ou uma roda para o polegar) desliza a faixa. %@ com a roda sempre faz isso, qualquer que seja este ajuste." } }, "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "倾斜鼠标滚轮(或拇指滚轮)即可滑动条带。无论如何设置,⌃⌥ 加滚轮始终可以滑动条带。" + "value" : "倾斜鼠标滚轮(或拇指滚轮)即可滑动条带。无论如何设置,%@ 加滚轮始终可以滑动条带。" } } } @@ -5677,49 +5818,49 @@ } } }, - "With ⌃⌥" : { + "With %@" : { "extractionState" : "manual", "localizations" : { "de" : { "stringUnit" : { "state" : "translated", - "value" : "Mit ⌃⌥" + "value" : "Mit %@" } }, "es" : { "stringUnit" : { "state" : "translated", - "value" : "Con ⌃⌥" + "value" : "Con %@" } }, "fr" : { "stringUnit" : { "state" : "translated", - "value" : "Avec ⌃⌥" + "value" : "Avec %@" } }, "ja" : { "stringUnit" : { "state" : "translated", - "value" : "⌃⌥を押しながら" + "value" : "%@を押しながら" } }, "ko" : { "stringUnit" : { "state" : "translated", - "value" : "⌃⌥ 사용 시" + "value" : "%@ 사용 시" } }, "pt-BR" : { "stringUnit" : { "state" : "translated", - "value" : "Com ⌃⌥" + "value" : "Com %@" } }, "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "使用 ⌃⌥" + "value" : "使用 %@" } } } @@ -6288,6 +6429,100 @@ } } }, + "⌃⌥ Control-Option" : { + "extractionState" : "manual", + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌃⌥ Control-Wahl" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌃⌥ Control-Opción" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌃⌥ Contrôle-Option" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌃⌥ Control-Option" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌃⌥ Control-Option" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌃⌥ Control-Option" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌃⌥ Control-Option" + } + } + } + }, + "⌥ Option" : { + "extractionState" : "manual", + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌥ Wahl" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌥ Opción" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌥ Option" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌥ Option" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌥ Option" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌥ Option" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "⌥ Option" + } + } + } + }, "⚠︎ %@" : { "extractionState" : "manual", "localizations" : { diff --git a/Sources/Glide/SettingsWindow.swift b/Sources/Glide/SettingsWindow.swift index d67dd40..c34c43f 100644 --- a/Sources/Glide/SettingsWindow.swift +++ b/Sources/Glide/SettingsWindow.swift @@ -108,6 +108,7 @@ struct SettingsView: View { var body: some View { let _ = controller.revision + let chord = controller.shortcuts.modifier.modifiers.symbols VStack(alignment: .leading, spacing: 12) { Form { Section("General") { @@ -174,10 +175,10 @@ struct SettingsView: View { set: { controller.horizontalWheelMode = $0 } )) { Text("Always").tag(HorizontalWheelMode.always) - Text("With ⌃⌥").tag(HorizontalWheelMode.withModifier) + Text("With \(chord)").tag(HorizontalWheelMode.withModifier) Text("Off").tag(HorizontalWheelMode.off) } - .help("Tilting the mouse wheel (or a thumb wheel) glides the strip. ⌃⌥ with the wheel always does, whatever this is set to.") + .help("Tilting the mouse wheel (or a thumb wheel) glides the strip. \(chord) with the wheel always does, whatever this is set to.") Toggle("Apps reopen where you keep them", isOn: Binding( get: { WindowManager.remembersApps }, set: { WindowManager.remembersApps = $0 } @@ -207,7 +208,30 @@ struct SettingsView: View { AppearanceSection(controller: controller) - AppRulesSection(store: controller.appRules) + AppRulesSection(store: controller.appRules, + floatCombo: controller.shortcuts.keymap.combo(for: .toggleFloating)?.description ?? String(localized: "A shortcut")) + + Section { + Picker("Glide modifier", selection: Binding( + get: { controller.shortcuts.modifier }, + set: { recorder.stop(); controller.shortcuts.modifier = $0 } + )) { + Text("⌃⌥ Control-Option").tag(GlideModifier.controlOption) + Text("⌥ Option").tag(GlideModifier.option) + } + } header: { + Text("Shortcuts") + } footer: { + Group { + if controller.shortcuts.modifier == .option { + Text("Every default shortcut uses ⌥, and ⇧ to move windows. ⌥ + arrows no longer jump by word in text, and ⌥ + letters and digits no longer type special characters like é or ©. Shortcuts you changed stay as they are.") + } else { + Text("Every default shortcut uses ⌃⌥, and ⇧ to move windows. Shortcuts you changed stay as they are.") + } + } + .font(.callout) + .foregroundStyle(.secondary) + } ForEach(Action.Group.allCases, id: \.self) { group in Section(group.title) { @@ -239,6 +263,7 @@ struct SettingsView: View { private struct AppRulesSection: View { let store: RuleStore + let floatCombo: String var body: some View { Section { @@ -258,7 +283,7 @@ private struct AppRulesSection: View { } header: { Text("App Rules") } footer: { - Text("Rules apply as windows open. Float and tile take effect right away; width and workspace apply to new windows. ⌃⌥V still floats or tiles a single window.") + Text("Rules apply as windows open. Float and tile take effect right away; width and workspace apply to new windows. \(floatCombo) still floats or tiles a single window.") .font(.callout) .foregroundStyle(.secondary) } @@ -442,8 +467,8 @@ private struct ShortcutRow: View { Image(systemName: "arrow.uturn.backward") } .buttonStyle(.borderless) - .help("Restore the default (\(Keymap.defaults[action]?.description ?? String(localized: "none")))") - .disabled(combo == Keymap.defaults[action]) + .help("Restore the default (\(controller.shortcuts.keymap.defaultCombo(for: action)?.description ?? String(localized: "none")))") + .disabled(combo == controller.shortcuts.keymap.defaultCombo(for: action)) } } } diff --git a/Sources/Glide/ShortcutStore.swift b/Sources/Glide/ShortcutStore.swift index 02b6a04..808778d 100644 --- a/Sources/Glide/ShortcutStore.swift +++ b/Sources/Glide/ShortcutStore.swift @@ -6,11 +6,13 @@ import Observation @Observable final class ShortcutStore { private static let key = "shortcuts" + private static let modifierKey = "glideModifier" private let defaults: UserDefaults private(set) var keymap: Keymap { didSet { defaults.set(keymap.storage, forKey: Self.key) + defaults.set(keymap.modifier.rawValue, forKey: Self.modifierKey) onChange?() } } @@ -19,7 +21,13 @@ final class ShortcutStore { init(defaults: UserDefaults = .standard) { self.defaults = defaults - keymap = Keymap(storage: defaults.dictionary(forKey: Self.key) as? [String: String] ?? [:]) + let modifier = defaults.string(forKey: Self.modifierKey).flatMap(GlideModifier.init(rawValue:)) ?? .controlOption + keymap = Keymap(modifier: modifier, storage: defaults.dictionary(forKey: Self.key) as? [String: String] ?? [:]) + } + + var modifier: GlideModifier { + get { keymap.modifier } + set { keymap.setModifier(newValue) } } @discardableResult diff --git a/Sources/Glide/WheelMonitor.swift b/Sources/Glide/WheelMonitor.swift index d43db5c..f945984 100644 --- a/Sources/Glide/WheelMonitor.swift +++ b/Sources/Glide/WheelMonitor.swift @@ -4,7 +4,8 @@ import GlideCore /// One mouse-wheel tick. Notches are positive when the content should move right. struct WheelTick { var horizontal: Bool - var chordHeld: Bool + /// The modifiers held during the tick. + var modifiers: KeyModifiers var notches: Double } @@ -47,7 +48,11 @@ final class WheelMonitor { fileprivate func process(_ event: CGEvent) -> Bool { guard event.getIntegerValueField(.scrollWheelEventIsContinuous) == 0, let handle else { return false } let flags = event.flags - let chordHeld = flags.contains(.maskControl) && flags.contains(.maskAlternate) + var modifiers: KeyModifiers = [] + if flags.contains(.maskControl) { modifiers.insert(.control) } + if flags.contains(.maskAlternate) { modifiers.insert(.option) } + if flags.contains(.maskShift) { modifiers.insert(.shift) } + if flags.contains(.maskCommand) { modifiers.insert(.command) } // Tilt (axis 2) is positive to the right; the vertical wheel (axis 1) is positive when scrolling up. let horizontal = event.getDoubleValueField(.scrollWheelEventFixedPtDeltaAxis2) != 0 let notches: Double @@ -57,7 +62,7 @@ final class WheelMonitor { notches = -event.getDoubleValueField(.scrollWheelEventFixedPtDeltaAxis1) } guard notches != 0 else { return false } - return handle(WheelTick(horizontal: horizontal, chordHeld: chordHeld, notches: notches)) + return handle(WheelTick(horizontal: horizontal, modifiers: modifiers, notches: notches)) } } diff --git a/Sources/GlideCore/Keymap.swift b/Sources/GlideCore/Keymap.swift index 0b05e09..a2976ef 100644 --- a/Sources/GlideCore/Keymap.swift +++ b/Sources/GlideCore/Keymap.swift @@ -1,12 +1,30 @@ import Foundation +/// The modifier every default shortcut is built on: the "Glide" chord. +public enum GlideModifier: String, CaseIterable, Sendable { + /// ⌃⌥: leaves text editing and typed characters alone. + case controlOption + /// ⌥ alone: easier to press, but takes over ⌥ + arrows (word jumps) and ⌥ + letters (special characters). + case option + + public var modifiers: KeyModifiers { + switch self { + case .controlOption: [.control, .option] + case .option: .option + } + } +} + /// Which shortcut triggers which action: the defaults plus any user overrides. public struct Keymap: Equatable, Sendable { - /// Defaults are ⌃⌥ for focus/commands and ⌃⌥⇧ for "move", plus ⌘ for displays. See the README - /// for the reasoning. - public static let defaults: [Action: KeyCombo] = { - let hyper: KeyModifiers = [.control, .option] - let move: KeyModifiers = [.control, .option, .shift] + /// The defaults for the standard ⌃⌥ chord. + public static let defaults = defaults(for: .controlOption) + + /// Defaults are the Glide modifier for focus/commands and the modifier plus ⇧ for "move", plus ⌘ + /// for displays. See the README for the reasoning. + public static func defaults(for modifier: GlideModifier) -> [Action: KeyCombo] { + let hyper = modifier.modifiers + let move = hyper.union(.shift) var map: [Action: KeyCombo] = [ .focusColumnLeft: KeyCombo(KeyCode.leftArrow, hyper), .focusColumnRight: KeyCombo(KeyCode.rightArrow, hyper), @@ -40,25 +58,32 @@ public struct Keymap: Equatable, Sendable { .moveColumnToDisplayLeft: KeyCombo(KeyCode.leftArrow, move.union(.command)), .moveColumnToDisplayRight: KeyCombo(KeyCode.rightArrow, move.union(.command)), ] - // ⌃⌥1…9 switch workspaces; ⌃⌥⇧1…9 send the focused window there. + // Modifier + 1…9 switch workspaces; with ⇧ they send the focused window there. for (index, key) in KeyCode.digits.enumerated() { let number = index + 1 if let focus = Action(rawValue: "focusWorkspace\(number)") { map[focus] = KeyCombo(key, hyper) } if let send = Action(rawValue: "moveColumnToWorkspace\(number)") { map[send] = KeyCombo(key, move) } } return map - }() + } + /// The modifier the defaults are built on. + public private(set) var modifier: GlideModifier /// Overrides of the defaults. A nil value means the user removed the shortcut. public private(set) var overrides: [Action: KeyCombo?] - public init(overrides: [Action: KeyCombo?] = [:]) { + public init(modifier: GlideModifier = .controlOption, overrides: [Action: KeyCombo?] = [:]) { + self.modifier = modifier self.overrides = overrides } + public func defaultCombo(for action: Action) -> KeyCombo? { + Self.defaults(for: modifier)[action] + } + public func combo(for action: Action) -> KeyCombo? { if let override = overrides[action] { return override } - return Self.defaults[action] + return defaultCombo(for: action) } public func action(for combo: KeyCombo) -> Action? { @@ -86,7 +111,7 @@ public struct Keymap: Equatable, Sendable { } public mutating func reset(_ action: Action) { - let displaced = Action.allCases.filter { $0 != action && combo(for: $0) == Self.defaults[action] } + let displaced = Action.allCases.filter { $0 != action && combo(for: $0) == defaultCombo(for: action) } overrides[action] = nil for other in displaced { store(nil, for: other) } } @@ -95,8 +120,23 @@ public struct Keymap: Equatable, Sendable { overrides = [:] } + /// Rebuilds the defaults on another modifier. Shortcuts the user set keep working, and win + /// over a new default that lands on the same keys. + public mutating func setModifier(_ modifier: GlideModifier) { + let custom = overrides + self.modifier = modifier + overrides = [:] + for (action, combo) in custom { + if let combo { + set(combo, for: action) + } else { + store(nil, for: action) + } + } + } + private mutating func store(_ combo: KeyCombo?, for action: Action) { - if combo == Self.defaults[action] { + if combo == defaultCombo(for: action) { overrides[action] = nil } else { overrides[action] = .some(combo) @@ -116,7 +156,7 @@ public struct Keymap: Equatable, Sendable { return result } - public init(storage: [String: String]) { + public init(modifier: GlideModifier = .controlOption, storage: [String: String]) { var overrides: [Action: KeyCombo?] = [:] for (key, value) in storage { guard let action = Action(rawValue: key) else { continue } @@ -126,7 +166,7 @@ public struct Keymap: Equatable, Sendable { overrides[action] = .some(combo) } } - self.init(overrides: overrides) + self.init(modifier: modifier, overrides: overrides) } } diff --git a/Tests/GlideCoreTests/KeymapTests.swift b/Tests/GlideCoreTests/KeymapTests.swift index 78484dc..a1005fb 100644 --- a/Tests/GlideCoreTests/KeymapTests.swift +++ b/Tests/GlideCoreTests/KeymapTests.swift @@ -85,6 +85,39 @@ final class KeymapTests: XCTestCase { XCTAssertEqual(keymap, Keymap()) } + func testOptionModifierDefaults() { + let defaults = Keymap.defaults(for: .option) + XCTAssertEqual(Set(defaults.keys), Set(Keymap.defaults.keys)) + XCTAssertEqual(Set(defaults.values).count, defaults.count) + XCTAssertEqual(defaults[.focusColumnLeft]?.description, "⌥←") + XCTAssertEqual(defaults[.moveColumnRight]?.description, "⌥⇧→") + XCTAssertEqual(defaults[.focusDisplayLeft]?.description, "⌥⌘←") + XCTAssertEqual(defaults[.focusWorkspace1], KeyCombo(18, .option)) + } + + func testChangingModifierKeepsCustomShortcuts() { + var keymap = Keymap() + keymap.set(KeyCombo(KeyCode.c, .option), for: .toggleOverview) + keymap.set(nil, for: .toggleTiling) + keymap.setModifier(.option) + XCTAssertEqual(keymap.combo(for: .focusColumnLeft), KeyCombo(KeyCode.leftArrow, .option)) + XCTAssertNil(keymap.combo(for: .toggleTiling)) + // The custom ⌥C wins over centerColumn's new default. + XCTAssertEqual(keymap.action(for: KeyCombo(KeyCode.c, .option)), .toggleOverview) + XCTAssertNil(keymap.combo(for: .centerColumn)) + XCTAssertEqual(Set(keymap.bindings.map(\.combo)).count, keymap.bindings.count) + + keymap.reset(.centerColumn) + XCTAssertEqual(keymap.combo(for: .centerColumn), KeyCombo(KeyCode.c, .option)) + XCTAssertNil(keymap.combo(for: .toggleOverview)) + } + + func testModifierSurvivesStorage() { + var keymap = Keymap(modifier: .option) + keymap.set(KeyCombo(4, [.control, .option, .command]), for: .focusColumnLeft) + XCTAssertEqual(Keymap(modifier: .option, storage: keymap.storage), keymap) + } + func testCarbonFlags() { XCTAssertEqual(KeyModifiers([.control, .option]).carbonFlags, 0x1800) XCTAssertEqual(KeyModifiers([.command, .shift]).carbonFlags, 0x0300) diff --git a/changelog/CHANGELOG.de.md b/changelog/CHANGELOG.de.md index 4bf0f03..4aeec20 100644 --- a/changelog/CHANGELOG.de.md +++ b/changelog/CHANGELOG.de.md @@ -2,6 +2,12 @@ Neuigkeiten in jeder Version von Glide für Mac. Glide zeigt die neuen Einträge einmal nach einem Update an, und die Hinweise zu jedem Release auf GitHub stammen von hier. Dies ist eine Übersetzung von CHANGELOG.md, das Original ist die englische Datei. +## 0.11.2 — 2026-10-30 + +### Neu + +- **⌥ allein als Glide-Modifikatortaste.** Einstellungen › Tastenkürzel › Glide-Modifikatortaste stellt alle Standard-Tastenkürzel von ⌃⌥ auf ⌥ um, wie bei AeroSpace und ähnlichen Apps: ⌥→ fokussiert nach rechts, ⌥⇧→ verschiebt das Fenster, und ⌥ + Mausrad bewegt das Band. ⌥ + Pfeiltasten springen in Text dann nicht mehr wortweise, und ⌥ + Buchstaben und Ziffern tippen keine Zeichen wie é oder © mehr. Tastenkürzel, die du selbst geändert hast, bleiben unverändert. + ## 0.11.1 — 2026-10-20 ### Änderungen diff --git a/changelog/CHANGELOG.es.md b/changelog/CHANGELOG.es.md index d9adfef..12fdf69 100644 --- a/changelog/CHANGELOG.es.md +++ b/changelog/CHANGELOG.es.md @@ -2,6 +2,12 @@ Novedades de cada versión de Glide para Mac. Glide muestra las entradas nuevas una sola vez tras actualizarse, y las notas de cada versión en GitHub salen de aquí. Esta es una traducción de CHANGELOG.md, que es el original. +## 0.11.2 — 2026-10-30 + +### Novedades + +- **Usa solo ⌥ como tecla modificadora de Glide.** Ajustes › Atajos › Tecla modificadora de Glide cambia todos los atajos predeterminados de ⌃⌥ a ⌥, como hacen AeroSpace y apps parecidas: ⌥→ enfoca a la derecha, ⌥⇧→ mueve la ventana y ⌥ + rueda recorre la tira. A cambio, ⌥ + flechas ya no saltan de palabra en palabra en el texto, y ⌥ + letras y números ya no escriben caracteres como é o ©. Los atajos que hayas cambiado tú se quedan como están. + ## 0.11.1 — 2026-10-20 ### Cambios diff --git a/changelog/CHANGELOG.fr.md b/changelog/CHANGELOG.fr.md index bd9699a..308ab21 100644 --- a/changelog/CHANGELOG.fr.md +++ b/changelog/CHANGELOG.fr.md @@ -2,6 +2,12 @@ Ce fichier est la traduction française de CHANGELOG.md, qui reste l’original. Il présente les nouveautés de chaque version de Glide pour Mac. Glide affiche les nouvelles entrées une seule fois après une mise à jour, et les notes de chaque version sur GitHub en sont issues. +## 0.11.2 — 2026-10-30 + +### Nouveautés + +- **Utilisez ⌥ seule comme touche de modification de Glide.** Réglages › Raccourcis › Touche de modification de Glide fait passer tous les raccourcis par défaut de ⌃⌥ à ⌥, comme AeroSpace et les apps similaires : ⌥→ active la fenêtre de droite, ⌥⇧→ déplace la fenêtre et ⌥ + molette fait glisser la bande. ⌥ + flèches ne sautent alors plus de mot en mot dans le texte, et ⌥ + lettres et chiffres ne tapent plus de caractères comme é ou ©. Les raccourcis que vous avez modifiés vous-même restent tels quels. + ## 0.11.1 — 2026-10-20 ### Modifications diff --git a/changelog/CHANGELOG.ja.md b/changelog/CHANGELOG.ja.md index bdddedf..b1add80 100644 --- a/changelog/CHANGELOG.ja.md +++ b/changelog/CHANGELOG.ja.md @@ -2,6 +2,12 @@ Glide for Macの各バージョンの新機能です。このファイルは、原文であるCHANGELOG.mdの日本語訳です。 +## 0.11.2 — 2026-10-30 + +### 新機能 + +- **⌥だけをGlideの修飾キーにできるようになりました。** 設定 › ショートカット › Glideの修飾キー で、すべての標準ショートカットを⌃⌥から⌥に切り替えられます。AeroSpaceなどと同じく、⌥→で右にフォーカス、⌥⇧→でウインドウを移動、⌥+ホイールでストリップを動かします。その代わり、テキスト内で⌥+矢印キーによる単語単位の移動ができなくなり、⌥+文字や数字でéや©などの文字を入力できなくなります。自分で変更したショートカットはそのまま残ります。 + ## 0.11.1 — 2026-10-20 ### 変更点 diff --git a/changelog/CHANGELOG.ko.md b/changelog/CHANGELOG.ko.md index 9c1397a..646140c 100644 --- a/changelog/CHANGELOG.ko.md +++ b/changelog/CHANGELOG.ko.md @@ -2,6 +2,12 @@ Mac용 Glide의 버전별 새로운 기능입니다. 이 파일은 CHANGELOG.md의 한국어 번역이며, 원본은 CHANGELOG.md입니다. Glide는 업데이트 후 새 항목을 한 번 보여 줍니다. +## 0.11.2 — 2026-10-30 + +### 새 기능 + +- **⌥만 Glide 보조 키로 사용할 수 있습니다.** 설정 › 단축키 › Glide 보조 키에서 모든 기본 단축키를 ⌃⌥에서 ⌥로 바꿀 수 있습니다. AeroSpace 등과 마찬가지로 ⌥→는 오른쪽으로 포커스를 옮기고, ⌥⇧→는 윈도우를 이동하며, ⌥ + 휠은 스트립을 이동합니다. 대신 텍스트에서 ⌥ + 화살표로 단어 단위 이동을 할 수 없고, ⌥ + 문자나 숫자로 é나 © 같은 문자를 입력할 수 없게 됩니다. 직접 변경한 단축키는 그대로 유지됩니다. + ## 0.11.1 — 2026-10-20 ### 변경 사항 diff --git a/changelog/CHANGELOG.pt-BR.md b/changelog/CHANGELOG.pt-BR.md index 244411f..25ae037 100644 --- a/changelog/CHANGELOG.pt-BR.md +++ b/changelog/CHANGELOG.pt-BR.md @@ -2,6 +2,12 @@ Novidades de cada versão do Glide para Mac. O Glide mostra as novas entradas uma vez após se atualizar, e as notas de cada versão no GitHub vêm daqui, então escreva para quem usa o Glide. Adicione uma entrada para cada mudança que vale a pena conhecer na próxima versão antes de criar a tag. Esta é uma tradução de CHANGELOG.md, que é o original. +## 0.11.2 — 2026-10-30 + +### Novidades + +- **Use só ⌥ como tecla modificadora do Glide.** Ajustes › Atalhos › Tecla modificadora do Glide troca todos os atalhos padrão de ⌃⌥ para ⌥, como fazem o AeroSpace e apps parecidos: ⌥→ foca à direita, ⌥⇧→ move a janela e ⌥ + roda desliza a faixa. Em troca, ⌥ + setas deixam de pular de palavra em palavra no texto, e ⌥ + letras e números deixam de digitar caracteres como é ou ©. Os atalhos que você mesmo mudou continuam como estão. + ## 0.11.1 — 2026-10-20 ### Mudanças diff --git a/changelog/CHANGELOG.zh-Hans.md b/changelog/CHANGELOG.zh-Hans.md index dc74558..3c89f19 100644 --- a/changelog/CHANGELOG.zh-Hans.md +++ b/changelog/CHANGELOG.zh-Hans.md @@ -2,6 +2,12 @@ 这里记录了 Glide for Mac 每个版本的新变化。Glide 会在更新后显示一次新增的条目,GitHub 上每个版本的说明也来自这里,所以请以 Glide 用户的角度来写。本文件是 CHANGELOG.md 的译文,CHANGELOG.md 才是原文。每次发布前,请在下一个版本下为每项值得了解的改动添加一条记录。 +## 0.11.2 — 2026-10-30 + +### 新增 + +- **可以只用 ⌥ 作为 Glide 修饰键。** 设置 › 快捷键 › Glide 修饰键 可将所有默认快捷键从 ⌃⌥ 改为 ⌥,与 AeroSpace 等应用相同:⌥→ 聚焦右侧,⌥⇧→ 移动窗口,⌥ + 滚轮滑动条带。相应地,⌥ + 箭头键将不再在文本中按单词跳转,⌥ + 字母和数字也将不再输入 é 或 © 等字符。你自己更改过的快捷键保持不变。 + ## 0.11.1 — 2026-10-20 ### 变更 diff --git a/project.yml b/project.yml index ae8d41f..7441c6a 100644 --- a/project.yml +++ b/project.yml @@ -12,8 +12,8 @@ settings: SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY: YES CODE_SIGN_STYLE: Automatic DEVELOPMENT_TEAM: 435MC3786D - MARKETING_VERSION: "0.11.1" - CURRENT_PROJECT_VERSION: "16" + MARKETING_VERSION: "0.11.2" + CURRENT_PROJECT_VERSION: "17" ENABLE_HARDENED_RUNTIME: YES SWIFT_EMIT_LOC_STRINGS: YES LOCALIZATION_PREFERS_STRING_CATALOGS: YES