• 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: Keyboard shortcuts for views in toolbar items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keyboard shortcuts for views in toolbar items


  • Subject: Re: Keyboard shortcuts for views in toolbar items
  • From: Ondra Cada <email@hidden>
  • Date: Tue, 15 Oct 2002 17:19:55 +0200

On Tuesday, October 15, 2002, at 04:56 , j o a r wrote:

NSToolbarItem *item;
NSButton *button;
[button setAction: @selector(buttonAction:)];
[button setTarget: self];
[button setKeyEquivalent: @"j"];
[button setKeyEquivalentModifierMask: NSCommandKeyMask];
[item setView: button];

...and expected to be able to trigger the button action using the keyboard shortcut. It doesn't seem to work.
If someone could tell me how to do this, or if it is impossible in the current implementation of NSToolbar, I would be grateful.

Not sure whether it is the answer you wanna hear, but the proper way to do that is to place the actions and their key equivalents into main menu, so that they are accessible & work properly regardless the appropriate buttons are in the toolbar or not.

Generally it is a *very bad* practice to have services which are not accessible through the main menu. The key equivalent stuff just accents that.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Keyboard shortcuts for views in toolbar items
      • From: j o a r <email@hidden>
References: 
 >Keyboard shortcuts for views in toolbar items (From: j o a r <email@hidden>)

  • Prev by Date: Keyboard shortcuts for views in toolbar items
  • Next by Date: Re: NSProcessInfo operatingSystem anomaly
  • Previous by thread: Keyboard shortcuts for views in toolbar items
  • Next by thread: Re: Keyboard shortcuts for views in toolbar items
  • Index(es):
    • Date
    • Thread