NSViewでキーイベントを取得
NSViewのサブクラスで下記のメソッドをオーバーライドしてもキーイベントが取得できない。
- (void)keyDown:(NSEvent *)theEvent - (void)keyUp:(NSEvent *)theEvent - (void)flagsChanged:(NSEvent *)theEvent
NSViewのサブクラスでキーイベントを取得したい場合には、下記のようにacceptsFirstResponderをオーバーライドしYESを返せばOK。
- (BOOL)acceptsFirstResponder { return YES ; }