Re: Tab and Enter in NSTextView
Re: Tab and Enter in NSTextView
- Subject: Re: Tab and Enter in NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Tue, 5 Sep 2006 12:11:32 -0700
On Sep 3, 2006, at 11:36 AM, Spencer Salazar wrote:
even easier (I think), you could also implement NSTextView's
textView:doCommandBySelector: delegate method, and check to see if
the selector is insertTab:.
See:
http://developer.apple.com/documentation/Cocoa/Conceptual/
TextEditing/Tasks/InterceptKeys.html
That would be the recommended mechanism. You would probably want to
consider insertBacktab: as well.
I devoted a section of my talk at the recent WWDC to discussing
exactly why you don't want to override keyDown: for this sort of
thing. The gist of it is that keyDown: receives unprocessed key
events, and that handling them at this point is likely to break
things like input methods.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden