• 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
Problem with setKeyEquivalentModifierMask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with setKeyEquivalentModifierMask


  • Subject: Problem with setKeyEquivalentModifierMask
  • From: Scott Mitchell <email@hidden>
  • Date: Fri, 23 Jun 2006 14:27:04 -0600

I am trying to set my menu items with a user specified Key combination. So they set the key combo they,
the Key String and the modifiers are correct, but when I go to set the Key Code and Modifiers for the
menu item the Key Code is fine, but the modifiers do not show correctly in the menu. No matter what I
do it shows up as the Shift Key modifier in the menu. Below is the code. I have verified and the Key Code
and the Modifiers are correct. Does anyone know why this might not be working? I have searched through the
archives and every thing I have seen looks like what I am doing.


NSString* keyCodeChar = [keyCombo stringForKeyCode];
NSMenuItem* setItem = [[NSMenuItem alloc] initWithTitle:setLabel
												action:@selector(setSelected:)
										keyEquivalent:@""];
[setItem setKeyEquivalentModifierMask:[keyCombo modifiers]];
[setItem setKeyEquivalent:keyCodeChar];


Thanks for any help in advance.

Thanks,
Scott Mitchell
Senior Macintosh Software Engineer
Excelsior Software
http://www.excelsiorsoftware.com


_______________________________________________ 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
  • Follow-Ups:
    • Re: Problem with setKeyEquivalentModifierMask
      • From: Rosyna <email@hidden>
    • Re: Problem with setKeyEquivalentModifierMask
      • From: Eric Schlegel <email@hidden>
  • Prev by Date: Off-Topic: Communicating with users
  • Next by Date: What is wrong with this code?
  • Previous by thread: Re: Off-Topic: Communicating with users
  • Next by thread: Re: Problem with setKeyEquivalentModifierMask
  • Index(es):
    • Date
    • Thread