Re: Knowing how a Text Editing Session ended
Re: Knowing how a Text Editing Session ended
- Subject: Re: Knowing how a Text Editing Session ended
- From: Mike Abdullah <email@hidden>
- Date: Wed, 21 Jul 2010 15:51:43 +0100
Look up the docs on NSTextDidEndEditingNotification. I believe the same user info gets handed out in controlTextDidEndEditing:
On 21 Jul 2010, at 15:30, Motti Shneor wrote:
> Hello Everyone.
>
> I'm implementing a programmatic wrapper for using an NSTextField on our custom view ---
>
> I programmatically create an NSTextField, Embed it in the super-view, then let the user type in text and as soon as the user finishes, I need to collect the typed string, plus the way the field was dismissed (Esc, Return, Tab, Back-Tab plus modification keys if any). I then release this NSTextField, until I need to create a new one.
>
>
> Now --- I tried to Implement the
>
> - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
>
> and the
>
> - (void)controlTextDidEndEditing:(NSNotification *)obj;
>
> NSControl delegate methods , and I even get them called.
>
> However, I don't know how to extract the REASON for the ending of the text editing session. From the input of these delegate, I can extract the FieldEditor responsible, but I don't know how to question it for the reason "I got here".
>
> I could subclass NSTextField and implement the
>
> -insertReturn and - insertTab methods (of NSResponder) and record the status (Still I don't know how to identify a Back-Tab or an option-Tab or an ctrl-Tab etc) but I try to refrain from subclassing NSTextField.
>
> Any hint will be greatly appreciated!
>
>
>
> Motti Shneor
> ------------------------------------------
> Senior Software Engineer
> Waves Audio ltd.
> [mailto: email@hidden]
>
>
>
>
> _______________________________________________
>
> 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
_______________________________________________
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