Re: menuNeedsUpdate for key equivalents?
Re: menuNeedsUpdate for key equivalents?
- Subject: Re: menuNeedsUpdate for key equivalents?
- From: Jim Prouty <email@hidden>
- Date: Tue, 18 Mar 2014 11:16:31 -0700
On Mar 18, 2014, at 7:45 AM, Kyle Sluder <email@hidden> wrote:
> On Mar 13, 2014, at 1:19 PM, Jim Prouty <email@hidden> wrote:
>>
>> We'd love to have menuNeedsUpdate: be called before Cocoa starts calling menuHasKeyEquivalent:forEvent:target:action:.
>
> Why can't you just do your custom key equivalent handling within an implementation of this method?
>
> --Kyle Sluder
Because menuHasKeyEquivalent:forEvent:target:action: is asking only menu(s) it knows about whether they contain the key equivalent, and we very likely are about to change which menu/menu item has that key equivalent with our just-in-time approach (the MenuSelect method from Carbon).
We need a chance to change all the menus and menu items and force Cocoa to look at them all for where the key equivalent is used after those changes.
For example, command-A can be assigned to “Select All” in the Edit menu for most active (key) windows or to “Autoscale” in the Graph menu for active graph windows.
We need a chance to make that change (and many others like it). Mostly to get Cocoa to check the right menus for the key equivalent.
Right now we’re not getting calls to menuHasKeyEquivalent:forEvent:target:action: when command-A is pressed unless the menu is clicked/populated.
Maybe we need to snoop the raw NSEvent to see if it is a known or potential key equivalent.
(And yes, I know we’re “swimming against the tide” vis-à-vis Cocoa here.)
—Jim
========================================================================
Jim "How does it work?" Prouty
Voice: (503) 620-3001, FAX: (503) 620-6754
Makers of IGOR Pro, scientific data analysis and graphing for Mac and PC
http://www.wavemetrics.com
_______________________________________________
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