Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions TablePro/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 == KeyCode.f.rawValue else { return event }
NSApp.keyWindow?.toggleFullScreen(nil)
return nil
}
}

func applicationDidBecomeActive(_ notification: Notification) {
Expand Down
Loading