A small native macOS utility that keeps keyboard focus aligned with the display containing your pointer.
Rohit Das · macOS 14+ · Apple Silicon and Intel · SwiftUI + AppKit · No analytics
ScreenFocus lives in the menu bar. When your pointer crosses to another display, it immediately highlights that display and moves keyboard focus to the window under the pointer—without requiring a click.
If there is no usable window under the pointer, ScreenFocus temporarily takes focus itself. Ordinary typing no longer reaches a text field on the previous display, while system-wide shortcuts from macOS, Raycast, Karabiner-Elements, and Logitech software remain available.
On macOS, moving the pointer to another display does not move keyboard focus. That makes it easy to press a shortcut over Display 2 and accidentally run it inside an editor that is still focused on Display 1. ScreenFocus closes that gap.
- Focuses the window under the pointer when crossing displays.
- Preserves window stacking by preferring the topmost window when destination windows overlap.
- Protects the previous text field when the new display has no target window.
- Shows an instant full-display border using your chosen color and opacity.
- Automatically follows the rounded corners and camera housing of a built-in Mac display.
- Includes optional corner markers and a completely hidden overlay mode.
- Preserves global shortcuts instead of intercepting the keyboard.
- Defers focus changes while dragging.
- Optionally pauses automatically when only one display is connected.
- Handles display reconnection and rearrangement.
- Runs as a lightweight menu-bar app.
- Requires no Screen Recording or Input Monitoring permission.
- Download the latest
ScreenFocus-x.y.z.zipfrom Releases. - Unzip it and drag
ScreenFocus.appinto/Applications. - Open ScreenFocus from Applications.
This project is locally signed rather than Apple-notarized. If macOS blocks the first launch, try opening the app once, then use:
System Settings → Privacy & Security → Security → Open Anyway
Apple documents this flow in Open a Mac app from an unknown developer.
For a release you obtained from this repository and personally trust, the Terminal fallback is:
xattr -dr com.apple.quarantine /Applications/ScreenFocus.app
open /Applications/ScreenFocus.appThat command removes macOS's downloaded-file quarantine marker. Do not use it on an app from an untrusted source.
The border works without permission, but focus transfer requires Accessibility:
- Open the ScreenFocus menu-bar item.
- Select Grant Accessibility Access.
- In System Settings → Privacy & Security → Accessibility, enable ScreenFocus.
- Return to ScreenFocus. Its status should change from Highlight only to Aligned.
ScreenFocus does not read the screen, record audio, monitor all keystrokes, or send data over the network. See Privacy.
- Click a text field on one display.
- Move the pointer over a window on another display without clicking.
- The new display highlights immediately and its window receives keyboard focus.
- Move over empty desktop space to engage the focus guard and protect the previous text field.
Open Settings… from the menu-bar item to change:
- Full border, corner markers, or no overlay.
- Highlight color.
- Edge gap, thickness, and opacity.
- Focus transfer.
- Automatic pause with only one connected display.
- Launch at login, enabled by default on first launch.
For status meanings, troubleshooting, and uninstall steps, read Help.
- macOS 14 or later.
- Xcode with Swift 6.2 or later.
- Xcode Command Line Tools.
- OpenSSL, included with current macOS developer environments.
git clone https://github.com/therohitdas/ScreenFocus.git
cd ScreenFocus
# One-time local signing setup. This keeps Accessibility approval stable.
./scripts/setup-local-signing.sh
# Build a Universal app for Apple Silicon and Intel.
./scripts/build-app.sh
open dist/ScreenFocus.appThe signing setup creates a ScreenFocus-only development certificate in your login keychain. It does not export or commit the private key.
To create a distributable archive and SHA-256 checksum:
./scripts/package-release.shFor the project structure and development workflow, see Development.
swift testAutomated tests cover display-crossing behavior, settings persistence, color parsing, overlay independence, overlapping-window ordering, and Settings-window behavior. Cross-application focus still needs a short manual test because macOS does not allow a test suite to grant Accessibility permission on a user's behalf.
| Permission | Needed | Why |
|---|---|---|
| Accessibility | Yes | Find, activate, and verify the intended destination window |
| Screen Recording | No | ScreenFocus does not capture display content |
| Input Monitoring | No | ScreenFocus does not install a global keyboard listener |
| Microphone / System Audio | No | ScreenFocus does not use audio |
- Installation and Gatekeeper
- Help and troubleshooting
- Development guide
- Privacy
- End User License Agreement
- Mozilla Public License 2.0
- Changelog
ScreenFocus source code and build scripts are licensed under the Mozilla Public License 2.0. If you distribute a modified version, files containing MPL-licensed code must remain available under the MPL.
The ScreenFocus name, app icon, logo, screenshots, and other branding are not licensed under the MPL. You may not present a modified build as an official ScreenFocus release or use that branding without permission. Official prebuilt releases are also subject to the End User License Agreement.
Copyright © 2026 Rohit Das.
0.5.5



