Re: Menu Key Equivalents Not Displayed
Re: Menu Key Equivalents Not Displayed
- Subject: Re: Menu Key Equivalents Not Displayed
- From: "Michael Ash" <email@hidden>
- Date: Sun, 6 Apr 2008 20:16:56 -0400
On Sun, Apr 6, 2008 at 3:37 PM, Jonathan Dann <email@hidden> wrote:
>
> >
> > On Apr 6, 2008, at 12:01 PM, Jonathan Dann wrote:
> >
> > > However the command-G does not show up on the menu. The same happens if
> I set the key equivalent to @"p", @"q" and some others, but equivalents like
> @"u" and @"b" work fine. Can anyone verify this for me please as I think
> I'm going mad.
> > >
> >
> >
> > Sounds like some sort of conflict with keyboard shortcuts used by menu
> items in the main menu?
> >
> > (g -> find next, p -> print, q -> quit, et.c.)
> >
> >
>
> Yeah I thought that, but couldn't see where g was defined. Any idea why it
> works in other contextual menus, including the main menu? Further
> investigation showed that when I set the selector to NULL for that menu
> item, it would show the shortcut. Setting it to j does the same so you may
> be right.
The menuing system (at least in 10.5, I believe this behavior is new)
is smart enough to realize that if two menu items have the same
target/action and the same keyboard shortcut then they are essentially
the same item and can therefore both show the shortcut. If the target
or action differ then it's unsafe to show the shortcut on the item
which won't process it, because the action taken will be different
from what the user sees.
In short, if your shortcut conflicts with an existing one then it
won't show. But if it matches an existing one including in terms of
behavior, then it will show.
Mike
_______________________________________________
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