Initializing hotkey in viewDidLoad() results in nothing when shortcut is activated
brendanballon opened this issue · 2 comments
brendanballon commented
Here's my code (I'm just making a test application)
import Cocoa
import HotKey
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
let hotkey = HotKey(keyCombo: KeyCombo(key: .p, modifiers: [.control, .command]))
hotkey.keyDownHandler = {
print("Something should happen")
}
// Do any additional setup after loading the view.
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
}
I'm just wondering if I'm doing any of this right, as you may be able to tell I'm a beginner.
tuanphamanh91 commented
@brendanballon hi, got same error, how did you handle it?
Liaoworking commented
same issue here