HotKey
HotKey copied to clipboard
Doesn't seem to work?
Hey, first thanks for creating the library, I was just in the process of setting it up, so I'm just doing some basic test, but this doesn't seem to work:
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Register global hotkey
let hotkey = HotKey(keyCombo: KeyCombo(key: .r, modifiers: [.command, .option]))
hotkey.keyDownHandler = {
print("Something should happen")
}
Am I registering it the wrong place or?
Ah, I just got it working, the hotkey declaration cannot be a local variable, it needs to be in the class so it doesn't get de-allocated, I think it would be useful to mention it on the Readme, I will create a PR
https://github.com/soffes/HotKey/pull/27
Thank you so much @ospfranco, it's truly helpful! 🙏🏻
thanks I needed this! needs to be added to readme
thanks
thanks