• 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: Sending a message to super's super (tab keyDown in NSTextView)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending a message to super's super (tab keyDown in NSTextView)


  • Subject: Re: Sending a message to super's super (tab keyDown in NSTextView)
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 21 Aug 2008 09:09:52 -0700


On Aug 21, 2008, at 1:22 AM, Jerry Krinock wrote:

When the 'tab' or 'backTab' key is pressed, NSTextView accepts it as a character to be typewritten. But sometimes I want NSTextView to behave like an NSTextField, with 'tab' or 'backTab' selecting the next or previous key view. So, in my NSTextView subclass, I over- ride -keyDown: and re-implement the next/previous view selection.

You really don't want to do this. You've just broken any input method that uses tab or backtab. I've posted about this many times before-- take a look at the list archives.


If you want NSTextView to behave like a text field with regard to tabs and returns, call setFieldEditor:YES on it. If you need some different behavior for individual keys, use the delegate method textView:doCommandBySelector: or subclass and override doCommandBySelector:.

Douglas Davidson

_______________________________________________

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: 
 >Sending a message to super's super (tab keyDown in NSTextView) (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Obtaining rotation from CTM
  • Next by Date: [Q] SFPreferenceView and authorize as admin?
  • Previous by thread: Re: Sending a message to super's super (tab keyDown in NSTextView)
  • Next by thread: Source List groups shifted down in NSOutlineView
  • Index(es):
    • Date
    • Thread