FROM : Scott Mitchell
DATE : Fri Jun 23 22:27:04 2006
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
DATE : Fri Jun 23 22:27:04 2006
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
| Related mails | Author | Date |
|---|---|---|
| Scott Mitchell | Jun 23, 22:27 | |
| Eric Schlegel | Jun 23, 23:37 | |
| Scott Mitchell | Jun 24, 00:24 | |
| Rosyna | Jun 24, 20:07 | |
| Scott Mitchell | Jun 26, 17:15 |






Cocoa mail archive

