• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Return key should enter return in textfield and not press default button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Return key should enter return in textfield and not press default button


  • Subject: Re: Return key should enter return in textfield and not press default button
  • From: Jim Correia <email@hidden>
  • Date: Mon, 18 Oct 2010 20:13:43 -0700

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 (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

References: 
 >Return key should enter return in textfield and not press default button (From: Thorsten Lemke <email@hidden>)

  • Prev by Date: Re: AM/PM letter UNICODE issues
  • Next by Date: Re: Heapshot Analysis to find Memory Accretion (Leaks)
  • Previous by thread: Re: Return key should enter return in textfield and not press default button
  • Next by thread: Cycle Through Windows menu item
  • Index(es):
    • Date
    • Thread