I am developing a Mac app using Swift 4 which only runs as an Agent (it only has a menu in the tray). I'm completely new to Swift.
I want it to respond to keyboard shortcuts, but the basic shortcuts (see picture) only work when the app has focus (in my case, when the menu is being clicked).
So what I need is for my app to respond to system-wide keyboard shortcuts.
I've tried:
- HotKey but it doesn't seem to be compatible with Swift 4, or perhaps I can't use Swift Package Manager
- this answer but again Swift 4 raises several errors that I couldn't solve
Has anyone done it?