Re: Menu Item's Key Equivalents Affecting Other Item
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