Reputation: 225
I wrote an app using Xcode 9.4 and Swift 4.1 for Mac OS X High Sierra. It has a custom NSView and a custom NSViewController. The custom NSView class has override functions defined for handling keyboard events (keyUp and keyDown). (It also has an override for acceptsFirstResponder property that returns true.)
If the user types X key, the app builds an NSAlert object with message text and 2 buttons and displays it in sheet modal form. The alert can be dismissed in one of 3 ways:
The problem is that in cases 2 and 3 the keyboard event for the key used to dismiss the NSAlert is propagated to the custom NSView keyboard handlers. Is there a way to disable this propagation?
Upvotes: 0
Views: 165