[comp.sys.mac.programmer] How can I assign command-key combination to an apple menu ?

deadman@garnet.berkeley.edu (Ben Haller) (09/28/90)

In article <1990Sep24.143023.29057@cerc.utexas.edu> min@cerc.utexas.edu
(Hyoung Bok Min) writes:
>I wrote a small DA. And I'm currently using it frequently.
>I want to give it a command-key equivalent so that the DA can be chosen using
>a command-key combination rather than choosing it from the apple menu.

Well, I've never actually done this that I can recall, but...I think the
Toolbox builds the Apple menu in such a way that any standard menu
meta-characters are used correctly.  So since a menu item whose name ends
in a /x (where x is any normal character) is given x as its command key,
you should be able to call your DA something like MyDA/L and it should
use Command-L.  Of course, you risk causing problems with any applications
that want to use that command key for menu items.  A better idea might be
to consider writing it as an FKEY.  At least make the key
user-configurable.

-Ben Haller (deadman@garnet.berkeley.edu)