• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Key equivalents for non-menu items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key equivalents for non-menu items


  • Subject: Re: Key equivalents for non-menu items
  • From: Kyle Sluder <email@hidden>
  • Date: Tue, 15 Feb 2011 18:11:57 -0800

On Tue, Feb 15, 2011 at 5:40 PM, Randy Widell <email@hidden> wrote:
> I am trying to wrap my mind around something and the Apple docs are just not
> helping.  I am not sure if I am looking in the wrong places or what, but I
> am just not getting it.
>
> Binding a menu item to First Responder and setting a key equivalent for the
> menu item is trivial.
>
> However, what if I want a key equivalent for a command that is not in a
> menu?

The canonical answer is, "You make a menu item for it."

> I am approaching this from years of Windows experience (which is probably
> part of the problem), so I am looking for something similar to an
> accelerator table.  I essentially duplicated this idea by overriding
> performKeyEquivalent: in a view, iterating through a table looking for a key
> code and modifier flag match, then performing that action.
>
> This "works", but I would have to duplicate this in every view that handles
> that command.

Would you mind elaborating on the action you're trying to provide a
shortcut for?

--Kyle Sluder
_______________________________________________

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

  • Follow-Ups:
    • Re: Key equivalents for non-menu items
      • From: Randy Widell <email@hidden>
References: 
 >Key equivalents for non-menu items (From: Randy Widell <email@hidden>)

  • Prev by Date: Key equivalents for non-menu items
  • Next by Date: Re: Key equivalents for non-menu items
  • Previous by thread: Key equivalents for non-menu items
  • Next by thread: Re: Key equivalents for non-menu items
  • Index(es):
    • Date
    • Thread