cancelOperation:
is not being called in my bare-bones NSView
subclass when I press Esc.
I checked and the Esc key is received on keyDown
. Also, other action messages (such as moveLeft
) are being called.
The view is part of a Window shown like this:
[self.window addChildWindow:wc.window ordered:NSWindowAbove];
[wc.window makeKeyAndOrderFront:self];
What am I doing wrong?
My derived
NSView
had the same problem. It was resolved after implementingacceptsFirstResponder
as follows: