Re: Arrow Keys in NSSlider
Re: Arrow Keys in NSSlider
- Subject: Re: Arrow Keys in NSSlider
- From: Quincey Morris <email@hidden>
- Date: Tue, 08 Sep 2015 20:47:14 +0000
On Sep 8, 2015, at 13:28 , Raglan T. Tiger <email@hidden> wrote:
>
> What more do I need do ?
It’s hard to say, but at the very least you’ll actually need to *make* the NSSlider first responder, which means you’ll have to click it first or tab to it.
You also don’t say what you think should happen if arrow keys should be pressed when some other view (e.g. a text field) is first responder.
Most likely, your solution will involved the following:
— Implement ‘keyDown’ in a view or controller higher up in the responder chain, an object that normally doesn’t respond to keystrokes.
— In your ‘keyDown’ override, invoke ‘interpretKeyEvents’ to handle the arrow keys.
— In a suitable controller class (possibly the same one), implement ‘moveUp/Down/Left/Right:’ action methods to deal with the slider.
— Filter out or reroute other events that aren’t relevant.
See the Cocoa Event Handling Guide (Handling Key Events) for more details.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden