> On Jul 4, 2018, at 21:31 , Ken Thomases <[email protected]> wrote:
> 
> On Jul 4, 2018, at 10:45 PM, Rick Mann <[email protected]> wrote:
>> 
>> I've overridden -acceptsFirstResponder to return true on the window 
>> controller and view controllers.
> 
> That doesn't do anything.  -acceptsFirstResponder is a view method and is 
> only called on views, not controllers.
> 
>> I don't have any custom views in the window yet, just an SCNView and a 
>> slider.
> 
> I don't know if SCNView accepts first responder by default.  You may need to 
> use a subclass that overrides -acceptsFirstResponder.

Hmm, I tried this. It doesn't seem to make anything in my responder chain 
respond. I tried calling becomeFirstResponder() on it when the view controller 
loaded. Doesn't seem to have any effect.

Dropping an NSTextView randomly into my window did enable my responder chain.

> 
> A slider would only accept first responder if System Preferences > Keyboard > 
> Shortcuts > Full Keyboard Access is set to All Controls.
> 
> 
>> This begins to touch on another issue I'm not satisfied with: if I have 
>> multiple NSViewControllers (say, in a split view), and I want them all to 
>> respond to (different) menu commands, there seems to be no way to do that 
>> directly, by sending command to the first responder, right?
> 
> Correct.  That's not an appropriate case for targeting the action at the 
> first responder.  You would either target the views directly or implement the 
> action methods in a superview or its controller and have that dispatch things 
> from there.  You could implement some general scheme that searches the 
> descendant views for one which responds and send it there.  Or perhaps have 
> the descendant views register their interest in a specific action method with 
> the controller.
> 
> Regards,
> Ken
> 


-- 
Rick Mann
[email protected]


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to