0
votes

I've a window with a split view. Left is a NSTableView, to the right a custom view.

When my custom view is active in a 'command mode' I need it to remain first responder status so it can receive a cancelOperation: event when the escape key is pressed. But I do want the user to be able to change the selection in the table view.

Unfortunately, as long as my custom view refuses to resign first responder status the table view doesn't respond.

How can I make sure that the table view allows changing the selection without becoming first responder? Or how can I make sure the cancelOperation: event is delivered to my custom view, while it's not first responder?

1

1 Answers

0
votes

the table view allows changing the selection without becoming first responder

Don't do this. It will confuse the user. The table view should become first responder.

Or how can I make sure the cancelOperation: event is delivered to my custom view, while it's not first responder

Put Cancel button in the window with key equivalent Escape. Or if you don't want a button, let an object in the responder chain (view controller, window controller) catch the escape key by implementing cancel: and tell the custom view to cancel.