• 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: OK on Enter, not Return
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OK on Enter, not Return


  • Subject: Re: OK on Enter, not Return
  • From: Andrew Merenbach <email@hidden>
  • Date: Fri, 06 Jun 2008 11:19:11 -0700

Quoting James Walker <email@hidden>:

I have a dialog containing an NSTextField and an OK button.  I'd like
the Enter key to act as an equivalent for the OK button, but the Return
key to add a line break to the text.  What's the best way to do that?

I believe that you might do some magic with -keyDown: -- I'm sure that someone else will have more knowledge about this -- but bear in mind that the latest-gen MacBooks (of which I have one) do not have separate Return and Enter keys -- just one. (Maybe the fn button changes it, but even if so, users would have to figure that out.) What about making alt-Enter/alt-Return add a newline, while leaving Return and Enter both to do the job of activating the OK button? Hope this helps, even if only a little!


Cheers,
Andrew
_______________________________________________

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


  • Follow-Ups:
    • Re: OK on Enter, not Return
      • From: Jim Correia <email@hidden>
    • Re: OK on Enter, not Return
      • From: "Clark Cox" <email@hidden>
    • Re: OK on Enter, not Return
      • From: Ken Thomases <email@hidden>
    • Re: OK on Enter, not Return
      • From: Douglas Davidson <email@hidden>
References: 
 >OK on Enter, not Return (From: James Walker <email@hidden>)

  • Prev by Date: Re: [Newbie] Proper class releasing
  • Next by Date: Re: Regular Expressions?
  • Previous by thread: OK on Enter, not Return
  • Next by thread: Re: OK on Enter, not Return
  • Index(es):
    • Date
    • Thread