• 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: Menu Item's Key Equivalents Affecting Other Item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Menu Item's Key Equivalents Affecting Other Item


  • Subject: Re: Menu Item's Key Equivalents Affecting Other Item
  • From: Ondra Cada <email@hidden>
  • Date: Sun, 8 May 2005 19:44:03 +0200

Seth,

On 7.5.2005, at 4:55, Seth Willits wrote:

The latest problem I'm having is a simple case where by changing one menu item's key equivalent, it changes another's as well. I'm attempting to do the same thing as Safari where it shifts around which menu item uses Cmd-W and which is Cmd-Shift-W.

Essentially I have:


- (void)windowDidBecomeKey:(NSNotification *)aNotification
{
// Close Window Menu Item
[CloseWindowItem setKeyEquivalent:@"W"];
[CloseWindowItem setKeyEquivalentModifierMask:NSCommandKeyMask | NSShiftKeyMask];

The NSShiftKeyMask here is actually superfluous, but no harm -- see below.



// Close Document Menu Item [CloseDocumentItem setKeyEquivalent:@"W"];

This is wrong. "W" already contains a Shift, so to speak -- since it is a shifted 'w'. Try ...setKeyEquivalent:@"w", and it'll work all right.


    [CloseDocumentItem setKeyEquivalentModifierMask:NSCommandKeyMask];
}


--- Ondra Čada OCSoftware: email@hidden http://www.ocs.cz private email@hidden http://www.ocs.cz/oc


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Menu Item's Key Equivalents Affecting Other Item (From: Seth Willits <email@hidden>)

  • Prev by Date: [NSInternalConsistencyException] Setting a drawer's new content view under Tiger
  • Next by Date: Re: Tiger documentation update
  • Previous by thread: Re: Menu Item's Key Equivalents Affecting Other Item
  • Next by thread: Tracking changes from bindings
  • Index(es):
    • Date
    • Thread