On Thu, Apr 23, 2009 at 5:16 PM, Kevin Gessner <ke...@kevingessner.com>wrote:

I've got this in MyEditorOutlineView, my NSOutlineView subclass.
>
> - (void)keyDown:(NSEvent *)theEvent {
>    [super keyDown:theEvent];
>
>    NSLog(@"keyDown: %d", [theEvent keyCode]);
>
>    #define returnKeyCode 36
>    switch([theEvent keyCode]) {
>        case returnKeyCode:
>            if([[self delegate] 
> respondsToSelector:@selector(newSiblingInEditor:)])
> {
>                [(NSObject<MyEditorOutlineViewDelegate> *)[self delegate]
> newSiblingInEditor:self];
>            }
>            break;
>    }
> }
>
> But it's never called when there's an editing session.


When you are in the middle of an editing session, the first responder is the
field editor. The field editor receives, and consumes, the keydown events.

Look at the NSResponder documentation for the -cancelOperation: method. This
should be bubbled up the responder chain if when escaped is pressed and the
field editor is active.

- Jim
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to