• 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: Closing a window with a textview using keyboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Closing a window with a textview using keyboard


  • Subject: Re: Closing a window with a textview using keyboard
  • From: Uli Kusterer <email@hidden>
  • Date: Mon, 10 Sep 2007 10:18:48 +0200

On 10.09.2007, at 09:31, Knut Lorenzen wrote:
Uli Kusterer (email@hidden) schrieb dereinst (am 09.09.2007
23:22 Uhr):
How does one resolve this dilemma? My 1st idea was to use <enter>
instead of
<return>, but how do I set this in Interface Builder?

I think you don't have to. Enter should be automatically re-mapped to the button that claims the return key. Or in short: It should Just Work(tm).

Thanks Uli, but that is exactly what I *don't* want. I would like to use
<enter> *instead* of <return>.

That would be non-standard. By default, the OS should do the following on a Mac:


-> The default button always listens to return *and* enter.
-> If a text field is there, it listens to return to mean "new line", but forwards "enter" to the default button.


That means that users can rely on enter *always* triggering the default button, while return gives new lines in text fields, and is exchangeable with enter in all other cases.

Don't try turning off the return key, it'll only confuse your users.

That said, you could probably subclass NSTextView. It inherits some NSResponder methods that handle return and enter, and you could probably override one of those. But I would recommend overriding the "enter" key to pass it up the responder chain as un-handled, so that enter always works, and leave return untouched in your app. Because that's what all other apps do in this particular case, and reversing behaviour from users expectations only increases your tech support load.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

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: 
 >Re: Closing a window with a textview using keyboard (From: Knut Lorenzen <email@hidden>)

  • Prev by Date: Re: Closing a window with a textview using keyboard
  • Next by Date: Re: Dragging to reorder rows in table not working
  • Previous by thread: Re: Closing a window with a textview using keyboard
  • Next by thread: Re: Closing a window with a textview using keyboard
  • Index(es):
    • Date
    • Thread