Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Martin Batholdy
That did it! Thank you! [newItem setKeyEquivalentModifierMask:SRCarbonToCocoaFlags(256)]; On 19.05.2011, at 15:45, Andy Lee wrote: > On May 19, 2011, at 9:24 AM, Martin Batholdy wrote: >> However >> [newItem setKeyEquivalentModifierMask:modifierMask]; >> has no effect / doesn't work. > > I w

Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Andy Lee
On May 19, 2011, at 9:24 AM, Martin Batholdy wrote: > However > [newItem setKeyEquivalentModifierMask:modifierMask]; > has no effect / doesn't work. I wonder if ShortcutRecorder stores Carbon masks instead of Cocoa masks. Maybe try converting with SRCarbonToCocoaFlags()? --Andy _

Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Martin Batholdy
> Haven't tried this, but looking at the functions in SRCommon I'd try > something like: > > NSString *keyString = SRStringForKeyCode(18); > NSUInteger modifierMask = 256; > NSMenuItem *myMenuItem = [[[NSMenuItem alloc] initWithTitle:@"My Menu Item" >

Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Andy Lee
On May 19, 2011, at 8:42 AM, Martin Batholdy wrote: > Hi, > > I use the ShortcutRecorder framework in order to let the user define a > shortcut for a given action. > > The ShortcutRecorder framework saves the shortcut into the preference plist > in the following form: > > keyCode: 18 > modifi

set keyEquivalent for an NSMenuItem

2011-05-19 Thread Martin Batholdy
Hi, I use the ShortcutRecorder framework in order to let the user define a shortcut for a given action. The ShortcutRecorder framework saves the shortcut into the preference plist in the following form: keyCode: 18 modifiers: 256 (for CMD +1) Now I would like to use this information from the