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: mot...@waves.com] > > > > > _______________________________________________ > > 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/cocoadev%40mikeabdullah.net > > This email sent to cocoa...@mikeabdullah.net _______________________________________________ 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