Re: Subverting the first responder chain
Re: Subverting the first responder chain
- Subject: Re: Subverting the first responder chain
- From: John Stiles <email@hidden>
- Date: Thu, 27 Mar 2008 18:14:24 -0700
The view doesn't immediately have a way of knowing whether it should
handle a key like "space" or not. The app design is predicated around
the idea that keyboard shortcuts will be consumed before they reach the
view, which I think is reasonable, and matches reality for standard
command keys.
The view can be connected to other blobs of code, and I am responsible
for passing along the message, "hey, the user pressed space!" But it
will gleefully consume the event no matter what I tell it was pressed.
Hamish Allan wrote:
On Fri, Mar 28, 2008 at 12:52 AM, John Stiles <email@hidden> wrote:
However, I have a few menu items which respond to atypical hotkeys (e.g.
one responds to "space", another to "option+X"). In this case, I've
found that the view gets a -keyDown: event, which it dutifully handles,
Perhaps the right way to look at it from the custom view's perspective
is not "should this be handled by the menu?" but "should this be
handled by me?"
If the answer to the latter question is "no", you should call "[super
keyDown:]". If the answer is "yes", you have an ambiguity in your
keyboard shortcuts.
Hamish
_______________________________________________
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