Optimized specifically for musicians using physically rotated portrait-oriented screens. Perfect coordinate mapping, edge-to-edge sheet music rendering, and focus-locked sheet scanning.
🔒 macOS Security Note: If macOS reports the downloaded app is "damaged" or cannot be opened, you can fix it in 5 seconds. Right-click the app and choose **Open**, or run `xattr -cr /Applications/RotatedBrowserApp.app` in your Terminal to clear the download quarantine.
A collection of deeply thought-out, pixel-perfect capabilities designed to solve hardware rotation constraints.
Natively intercepts and rotates physical mouse clicks and scroll coordinates. Clicks land exactly where they should under -90° or +90° displays.
Employs dynamic 1.18x over-zoomed scaling to push empty white margins off-screen, pulling musical staves perfectly edge-to-edge.
Loads directory folders into a beautiful file selection list detailing PDF names and byte sizes for quick browse-to-open sheet loading.
Turn pages using Left and Right Arrow keys or programmatic PgUp/PgDn keycodes, designed for hands-free foot pedal bindings.
Features a custom WKWebView browser that prevents focus dropping, allowing smooth scrolling with Option arrow key shortcuts.
Launches instantly in borderless fullscreen mode by default, immediately transforming your screen into a professional music stand.
Deep dive into how the app intercepts window event queues, applies rotation offsets, and routes events back into the SwiftUI hierarchy.
Our specialized Cocoa event router intercepts low-level window events, bypasses standard coordinates conversion, and remaps clicks based on real-time hardware orientation. This guarantees WKWebView and PDFView remain fully functional under rotation.
Bridging declarative layout systems with low-level window coordinate conversion matrices.
In AppKit, visual layout rotation is achieved using frameCenterRotation. However, SwiftUI's custom gesture engine processes coordinate movements internally during active drag-and-release loops.
When dragging or releasing a mouse click, SwiftUI's tracking engine fails to map coordinates through the frameCenterRotation transform matrix. This mismatch makes the engine treat mouse-up coordinates as physical screen values, thinking the user dragged away and released elsewhere. The button gesture is immediately cancelled.
Instead of fighting the declarative coordinate tracking system, we wrapped native Cocoa NSButton views using NSViewRepresentable.
By tweaking the window's hitTest(_:) implementation to check the target leaf control and its ancestral tree for "Button", physical events are routed directly to the native control. The native button handles its own drag-tracking loops natively, firing the actions perfectly every time.
Follow these quick steps to compile and launch the application natively on your Mac.
git clone https://github.com/j4dy/RotatedForMacMusicians.git cd RotatedForMacMusicians
swiftc RotatedBrowserApp.swift ContentView.swift WebView.swift PDFViewWrapper.swift -o net.j4dy.RotatedBrowserApp
./net.j4dy.RotatedBrowserApp