On Oct 11, 2010, at 2:21 AM, Thorsten Lemke wrote:

> I have a dialog in my app wich should let the user enter a carriage return.
> 
> How can I avoid pressing the default button with return? Only enter should
> press it in this case.

As you probably know, implementing this will be hugely popular with people who 
understand how it works, and confusing to everyone else.

That said…

For your edit field implement

- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView 
doCommandBySelector:(SEL)commandSelector;

When the command selector is insertNewline:, act accordingly based on the 
current event.

—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