Re: Making a NSFormatter receive special keys
Re: Making a NSFormatter receive special keys
- Subject: Re: Making a NSFormatter receive special keys
- From: Ali Lalani (list) <email@hidden>
- Date: Fri, 23 Aug 2002 15:08:57 -0400
On Friday, August 23, 2002, at 02:26 Uhr, Douglas Davidson wrote:
On Friday, August 23, 2002, at 10:28 AM, Clark S. Cox III wrote:
Is there a proper way to make a NSFormatter connected to a text editor
receive special keys like F1, up arrow, etc... When the user presses
them?
No, NSFormatters simply format and validate whatever is contained
inside
a control/cell, they don't ever directly get the keys that the user is
pressing, that is the control/cell's job.
Yes, it would usually be the job of the control or text view's delegate
instead, via such methods as
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView
doCommandBySelector:(SEL)commandSelector;
I'm not sure if this is the solution you're looking for, but i have
implemented a subclass of NSFormatter and captured special keys, in
this case to see if the Option key was pressed in combination with
another key. You can do this by calling [NSApp currentEvent] which will
return you an NSEvent instance from which you can determine exactly what
keys were pressed...hope this helps :)
Ali Lalani
e-mail: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.