override func keyDown(with event: NSEvent) {
switch event.modifierFlags.intersection(.deviceIndependentFlagsMask) {
case [.command] where event.characters == "9":
print("command-9")
case [.command] where event.keyCode == 123:
print("command-left arrow") // problem: this never executed
default:
break
}
}
Above is want I have tried. command-9 works like a charm. But command - arrow doesn't work.
It seems that if you press command - arrow, the modifier flag is not command. I searched the internet but couldn't get it work.