How to handle escape in NSTextField in SwiftUI

Issue #770

Handle cancelOperation somewhere up in responder chain

1
2
3
4
5
6
7
8
class MyWindow: NSWindow {
let keyHandler = KeyHandler()

override func cancelOperation(_ sender: Any?) {
super.cancelOperation(sender)
keyHandler.onEvent(.esc)
}
}

Comments