Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ides

macrumors member
Original poster
Mar 27, 2012
95
0
I have an NSViewController subclass and I would like to be able to receive keyboard events. However, currently the methods keyUp: and keyDown: are not being called on this view controller when keys are pressed in my app. In my view controller subclass I have this code:

Code:
 -(BOOL)acceptsFirstResponder {

     return YES;
}

AND
Code:
[self.view.window makeFirstResponder:self];

But the keyUp: and keyDown: methods are still not called on my view controller. My view controller's view is visible and takes up most of the screen.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.