Re: NSTextView keydown alternative?
Re: NSTextView keydown alternative?
- Subject: Re: NSTextView keydown alternative?
- From: Jim Correia <email@hidden>
- Date: Sat, 14 Jan 2006 08:06:36 -0500
On Jan 14, 2006, at 6:58 AM, Nik Youdale wrote:
I am building a custom view that consists of a textview (mainly)
which holds first responder status, and allows text input by the
user. I have implemented the
"textView:shouldChangeTextInRange:replacementString:" delegate
method to detect when characters are pressed, and to also detect
when keys such as return and tab are pressed so that i can disable
their action and/or invoke other methods.
What I need is someway of detecting when other keys are pressed
such as delete and arrow keys. I have tried overriding keydown, but
then i can't type into the textview. I need someway of detecting
these keystrokes and to still allow typing and the
"textView:shouldChangeTextInRange:replacementString:" delegate method.
If you are subclasses for other reasons, great. But you don't have to
subclass to customize the keystroke behavior. In addition to
textView:shouldChangeTextInRange:replacementString, look at - (BOOL)
textView:(NSTextView *)textView doCommandBySelector:(SEL)
commandSelector;
Jim
_______________________________________________
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