Re: ESC while editing NSOutlineView subclass
Re: ESC while editing NSOutlineView subclass
- Subject: Re: ESC while editing NSOutlineView subclass
- From: Jim Correia <email@hidden>
- Date: Thu, 23 Apr 2009 18:32:04 -0400
On Thu, Apr 23, 2009 at 5:16 PM, Kevin Gessner <email@hidden>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 (email@hidden)
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:
This email sent to email@hidden