Excellent! Thanks Pete!
-graham
On May 24, 2008, at 9:56 PM, Peter Burtis wrote:
Add the method -(BOOL)acceptsFirstResponder { return YES; } in the
custom and it will work as desired. By default, just clicking on an
custom NSView *doesn't* make it the first responder, and keyboard
eve
Add the method -(BOOL)acceptsFirstResponder { return YES; } in the
custom and it will work as desired. By default, just clicking on an
custom NSView *doesn't* make it the first responder, and keyboard
events are sent to the first responder and then up the responder
chain, unlike mouse even
1) Create a simple Cocoa application
2) Open IB and drag a Custom View over to the Window
3) Name the Custom View class
4) Write the class files and add them to the project
5) Derive a class from NSView and implement the keyDown method.
- (void)keyDown:(NSEvent *)theEvent;
6) Run the prog