From 02a18776d93afef292e372bfe99d07d7c4a07805 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 16 Dec 2020 22:08:58 +0700 Subject: [PATCH] Add FAQ item Fixes #34 --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index af1413ba..2b22e738 100644 --- a/readme.md +++ b/readme.md @@ -171,6 +171,10 @@ Most of the Carbon APIs were deprecated years ago, but there are some left that No. +#### How can I add an app-specific keyboard shortcut that is only active when the app is? + +That is outside the scope of this package. You can either use [`NSEvent.addLocalMonitorForEvents`](https://developer.apple.com/documentation/appkit/nsevent/1534971-addlocalmonitorforevents), [`NSMenuItem` with keyboard shortcut](https://developer.apple.com/documentation/appkit/nsmenuitem/2880316-allowskeyequivalentwhenhidden) (it can even be hidden), or SwiftUI's [`View#keyboardShortcut()` modifier](https://developer.apple.com/documentation/swiftui/form/keyboardshortcut(_:)). + ## Related - [Preferences](https://github.com/sindresorhus/Preferences) - Add a preferences window to your macOS app in minutes