views:

23

answers:

1

I have an OLD mac C/C++ program that I'm maintaining. It's still based on rsrc files and OS 9 system calls. (Yes, yes, I know. I'm TRYING to drag my company into the 21st century, but the other engineer is still using OSX10.3.9! please pity me)

I'm trying to get modifier shortcut functionality. Cmd-S works, for example. However, Opt-Cmd-S blinks the "File" menu, but doesn't do anything, UNLESS the file menu is already open.

I've looked through my code, and found that I'm taking the event message and passing it to MenuKey to tell me what menu option the key combo represents. However, MenuKey is always returning 0 if there are more than one modifier pressed.

I see from the apple documentation that this has been deprecated, but I'd rather not have to re-write the entire program just yet to move to nibs and so forth.

So, does anyone have a quick and dirty work around?

thanks.

+1  A: 

Well, nearly all of the Carbon UI has been deprecated (though MenuKey is more deprecated than some other bits). That's not to say it isn't still supported, but you should do any new development with Cocoa instead (even the version on 10.3.9 is a vast improvement over what you're doing).

If you're not used to working with Carbon, make sure to read the header files; there's a lot of documentation and useful hints in there which aren't anywhere else. You should use MenuEvent instead of MenuKey; MenuKey doesn't support modifiers other than the Command key.

Nicholas Riley
I can't seem to find any documentation on MenuEvent at the mac site. (or what there is, is all Java rather...) Can you point me at some C docs? thanks.
Brian Postow
http://developer.apple.com/legacy/mac/library/documentation/Carbon/Reference/Menu_Manager/Reference/reference.html#//apple_ref/doc/uid/TP30000227-CH1g-F03900
Nicholas Riley
Excellent! thanks. Also, especially thanks for the pointer to the legacy docs!
Brian Postow