AppKitFocusOverlay - Add hotkey(s) to display the key focus path for any window in your (running) AppKit application

Overview

AppKitFocusOverlay

A simple package for displaying the current focus target path for an AppKit window.

  • Press and hold option-[ key to display the focus key path for the currently focussed window
  • Press and hold option-] key to display the focus key path from the currently focussed UI element.

Supports both Swift and Objective-C projects.

Demo

Click here to see a demo video of the focus overlay added to the wonderful 'ControlRoom' application.

There is also a very basic AppKit example applications in both Swift and Objective-C in the Demo subfolder you can play with.

Simple setup

Define a global instance of AppKitFocusOverlay in your app and access the instance within a method that gets called early in your app's lifecycle, such as applicationDidFinishLaunching.

import AppKitFocusOverlay
let _globalFocusOverlay = AppKitFocusOverlay()

func applicationDidFinishLaunching(_ aNotification: Notification) {
   // Force the focus overlay instance to init.
   _ = _globalFocusOverlay
   ...
}

Features

Custom hotkeys

You can define the hotkeys to use in the initializer of the instance. By default, these are option-[ and option-], but you can change them to f13 and f14 (for example) if you want.

import AppKitFocusOverlay
import HotKey               // Available due to AppKitFocusOverlay dependency 

let _globalFocusOverlay: AppKitFocusOverlay(
   windowHotKey: HotKey(key: .f13, modifiers: []),
   viewHotKey: HotKey(key: .f14, modifiers: [])
)

func applicationDidFinishLaunching(_ aNotification: Notification) {
   // Force the focus overlay instance to init.
   _ = _globalFocusOverlay
   ...
}

Objective-C support

You can add AppKitFocusOverlay to your Objective-C project easily.

@import AppKitFocusOverlay;

@interface AppDelegate ()
/// Define an instance of the focus overlay
@property (nonatomic, strong) AppKitFocusOverlay* focusOverlay;
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification*)aNotification {
   /// Create the overlay and attach
   AppKitFocusOverlay* focus = [[AppKitFocusOverlay alloc] init];
   [self setFocusOverlay: focus];
}

@end

Note that if you need to customize the hotkeys for objective-c you'll need to fork this library and change the code in AppKitFocusOverlay.swift, as the HotKey library is not exposed through Objective-C and as such the hotkey-setting initializers are not exposed to objc.

Screenshots

Thanks!

Uses HotKey to define and detect hot-key presses.

License

MIT. Use it for anything you want, just attribute my work if you do. Let me know if you do use it somewhere, I'd love to hear about it!

MIT License

Copyright (c) 2021 Darren Ford

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

🖥 Control your display's brightness & volume on your Mac as if it was a native Apple Display
🖥 Control your display's brightness & volume on your Mac as if it was a native Apple Display

🖥 Control your display's brightness & volume on your Mac as if it was a native Apple Display. Use Apple Keyboard keys or custom shortcuts. Shows the native macOS OSDs.

Add to-do List  - a mobile application where you can add your to-dos and follow them
Add to-do List - a mobile application where you can add your to-dos and follow them

This project, is a mobile application where you can add your to-dos and follow them. You can add your to-do's.

Add the 'Hide Notification Badges' Focus mode setting from iOS to macOS
Add the 'Hide Notification Badges' Focus mode setting from iOS to macOS

FocusPlsNoBadges Add the 'Hide Notification Badges' Focus mode setting from iOS to macOS, in a really gross and hacky way. Getting started Build the X

Automatic testing of your Pull Requests on GitHub and BitBucket using Xcode Server. Keep your team productive and safe. Get up and running in minutes. @buildasaur
Automatic testing of your Pull Requests on GitHub and BitBucket using Xcode Server. Keep your team productive and safe. Get up and running in minutes. @buildasaur

Buildasaur Automatic testing of your Pull Requests on GitHub and BitBucket using Xcode Server. Keep your team productive and safe. Get up and running

AVXCAssets Generator takes path for your assets images and creates appiconset and imageset for you in just one click
AVXCAssets Generator takes path for your assets images and creates appiconset and imageset for you in just one click

AVXCAssets Generator Often while developing an app, We ran into a condition when we need to scale images to each and every aspect ratios for icons and

A simple to use iOS/tvOS/watchOS SDK to help get you off the ground quickly and efficiently with your Elastic Path Commerce Cloud written in Swift.

Elastic Path Commerce Cloud iOS Swift SDK A simple to use iOS/tvOS/watchOS SDK to help get you off the ground quickly and efficiently with your Elasti

A simple deamon that restores your window positions on external monitors.

Memmon Memmon remembers what your Mac forgets – A simple deamon that restores your window positions on external monitors. FAQ Why‽ I am frustrated! Wh

iOS App to display game lists and details with the ability to add games to your favorites list and see metacritic ratings.
iOS App to display game lists and details with the ability to add games to your favorites list and see metacritic ratings.

Game Data System - GDS Author: Heitor Silveira ([email protected]) iOS App to view games from various platforms, their description, release

Mac menu bar tool to view the architecture of the running application
Mac menu bar tool to view the architecture of the running application

Silicon Info About Silicon Info is a tiny menu bar application allows the user to quickly view the architecture of the currently running application.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Страницы доступны на sparrowcode.io/en & sparrowcode.io/ru Как добавить свое приложение Добавьте элемент в json /ru/apps/apps.json. Если ваше приложен

Advanced Catalyst Example with sidebar, list view, SwiftUI detail view, toolbar & AppKit bundle
Advanced Catalyst Example with sidebar, list view, SwiftUI detail view, toolbar & AppKit bundle

Advanced Catalyst Example This is an example of a Catalyst app using a three-column layout, with a primary toolbar. It includes topics such as: Drag &

An example of adding a faux notch using AppKit + SwiftUI
An example of adding a faux notch using AppKit + SwiftUI

faux-notch An example of adding a faux notch using AppKit + SwiftUI What is this? It's a bare-bones example that renders a fake MacBook notch in macOS

Match animations in SwiftUI and UIKit/AppKit
Match animations in SwiftUI and UIKit/AppKit

MatchedAnimation Match animations in SwiftUI and UIKit/AppKit. /// Draw a box in

A Swift library for documenting, isolating, and testing SwiftUI, UIKIt & AppKit components.
A Swift library for documenting, isolating, and testing SwiftUI, UIKIt & AppKit components.

A Swift library for documenting, isolating, and testing SwiftUI, UIKit & AppKit components. Minimal Example An example demonstrated with the Slider ui

FastLayout - A UIKit or AppKit package for fast UI design

FastLayout FastLayout is a UIKit or AppKit package for fast UI design. Layout Ex

The sample implementation of zip-archived document for a macOS AppKit platform.
The sample implementation of zip-archived document for a macOS AppKit platform.

The sample implementation of zip-archived document for a macOS AppKit platform. You can implement NSDocument-based I/O of archived document in your application like .sketch or .key.

Owner
Darren Ford
Darren Ford
📱 TabBar – highly customizable tab bar for your SwiftUI application.

TabBar SwiftUI standard TabView component is not so flexible and to customize it you have to modify appearance proxy of UITabBar or implement your own

Tamerlan Satualdypov 162 Jan 5, 2023
Send key events to any running macOS application.

KeySender An extremely simple micro package that enables you to send key events to any running application. Install Add the following to your Package.

Jordan Baird 5 Jul 31, 2022
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022
Catalyst example using an AppKit-provided NSVisualEffectView to provide a translucent blurred window

CatalystEffectViewChrome This project demonstrates how to insert an NSVisualEffe

Steven Troughton-Smith 68 Aug 11, 2022
AppKit Carbon key codes to UIKey-compatible enums

KeyCodes Versions of UIKey, UIKeyboardHIDUsage, and UIKeyModifierFlags that work with AppKit's NSEvent. No need for Carbon.HIToolbox. Aside from being

Chime 26 Nov 24, 2022
⚙ Add a preferences window to your macOS app in minutes

Preferences Add a preferences window to your macOS app in minutes Just pass in some view controllers and this package will take care of the rest. Requ

Sindre Sorhus 1.2k Jan 6, 2023
A realistic reflective shimmer to SwiftUI Views that uses device orientation. Position any View relative to device orientation to appear as if through a window or reflected by the screen.

A 3d rotation effect that uses Core Motion to allow SwiftUI views to appear projected in a specific direction and distance relative to the device in r

Ryan Lintott 235 Dec 30, 2022
Easily add vertical and horizontal pull to refresh to any UIScrollView. Can also add multiple pull-to-refesh views at once.

This is a fork from the famous SVPullToRefresh pod with 2 additional functionalities: Can add multiple pull-to-refresh views into one single UIScrollV

Hoang Tran 42 Dec 28, 2022
Virgil Core SDK allows developers to get up and running with Virgil Cards Service API quickly and add end-to-end security to their new or existing digital solutions to become HIPAA and GDPR compliant and more.

Virgil Core SDK Objective-C/Swift Introduction | SDK Features | Installation | Configure SDK | Usage Examples | Docs | Support Introduction Virgil Sec

Virgil Security, Inc. 27 Jul 26, 2022