From 40387a46044b9d042eec7587129998cefed2babf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ng=C3=B4=20Qu=E1=BB=91c=20=C4=90=E1=BA=A1t?= Date: Mon, 30 Mar 2026 11:33:31 +0700 Subject: [PATCH 1/2] fix: enable Globe+F (fn+F) fullscreen shortcut for SwiftUI lifecycle app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SwiftUI lifecycle apps don't create a real NSMenuItem for "Enter Full Screen" — the shortcut shown in the View menu is a visual hint only, with no key equivalent binding. macOS maps Globe+F to ⌃⌘F, so install a local event monitor to bridge the gap. --- TablePro/AppDelegate.swift | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/TablePro/AppDelegate.swift b/TablePro/AppDelegate.swift index 2ee34e2ac..ed3bfddf8 100644 --- a/TablePro/AppDelegate.swift +++ b/TablePro/AppDelegate.swift @@ -125,6 +125,25 @@ class AppDelegate: NSObject, NSApplicationDelegate { self, selector: #selector(handleDatabaseDidConnect), name: .databaseDidConnect, object: nil ) + + installFullscreenKeyMonitor() + } + + // MARK: - Fullscreen Shortcut + + /// macOS maps Globe+F (fn+F) to ⌃⌘F, but SwiftUI lifecycle apps don't + /// create a real NSMenuItem for "Enter Full Screen" — the shortcut shown + /// in the View menu is a visual hint only, with no key equivalent binding. + private var fullscreenKeyMonitor: Any? + + private func installFullscreenKeyMonitor() { + fullscreenKeyMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { event in + let mods = event.modifierFlags.intersection(.deviceIndependentFlagsMask) + guard mods == [.control, .command], + event.keyCode == 3 else { return event } + NSApp.keyWindow?.toggleFullScreen(nil) + return nil + } } func applicationDidBecomeActive(_ notification: Notification) { From 7fd154fc2bc35a80097ea613ddd13626ed4297b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ng=C3=B4=20Qu=E1=BB=91c=20=C4=90=E1=BA=A1t?= Date: Mon, 30 Mar 2026 11:40:17 +0700 Subject: [PATCH 2/2] fix: use KeyCode enum and add CHANGELOG entry --- CHANGELOG.md | 4 ++++ TablePro/AppDelegate.swift | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55206f1ef..5d5434f3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Globe+F (fn+F) fullscreen shortcut not working in SwiftUI lifecycle app + ## [0.26.0] - 2026-03-29 ### Added diff --git a/TablePro/AppDelegate.swift b/TablePro/AppDelegate.swift index ed3bfddf8..dca6b1cad 100644 --- a/TablePro/AppDelegate.swift +++ b/TablePro/AppDelegate.swift @@ -140,7 +140,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { fullscreenKeyMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { event in let mods = event.modifierFlags.intersection(.deviceIndependentFlagsMask) guard mods == [.control, .command], - event.keyCode == 3 else { return event } + event.keyCode == KeyCode.f.rawValue else { return event } NSApp.keyWindow?.toggleFullScreen(nil) return nil }