Re: Controlling participation in the keyView loop?
Re: Controlling participation in the keyView loop?
- Subject: Re: Controlling participation in the keyView loop?
- From: Ricky Sharp <email@hidden>
- Date: Thu, 24 Aug 2006 16:30:23 -0500
On Aug 24, 2006, at 4:18 PM, Jim Correia wrote:
Given a custom NSView or NSControl subclass, how do I:
- Specify whether the control is considered a "text box or list" or
"other" control for the purposes of whether it is included in the
keyView loop when depending on the current state of Full Keyboard
Access?
- Opt out of the keyboard loop entirely? (but still allow my view
to become the key view when clicked on)
- Determine when Full Keyboard Access is enabled? (but only if it
helps solve the first problem above, otherwise I don't care :-))
In controls that always need to have keyboard access, you implement:
- (BOOL)needsPanelToBecomeKey
{
return YES;
}
Note to also provide acceptsFirstResponder. In that, I typically do
this:
- (BOOL)acceptsFirstResponder
{
return ([self isEnabled] && [self anyOtherAttributesToCheck]);
}
I've done this in my app which is made up of all custom controls.
There's no need to check the state of Full Keyboard Access; using the
above code will let the framework do the right thing.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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