[comp.sys.atari.st.tech] Help needed w/menu keyboard equivalents

jfbruno@rodan.acs.syr.edu (John Bruno) (05/09/91)

I'm trying to write a GEM application, and I'd like to use keyboard 
equivalents for menu item selection.  How is this done? I see keyboard
equivalents mentioned in the docs, but how do I add them to the resource
file? And how does the application know that a keypress is a menu equivalent?
Is there some AES function that will tell you if a keypress is a menu
shortcut?  Any help would be appreciated...

---jb (jfbruno@rodan.acs.syr.edu)

steve@thelake.mn.org (Steve Yelvington) (05/09/91)

[In article <1991May9.064457.19554@rodan.acs.syr.edu>,
     jfbruno@rodan.acs.syr.edu (John Bruno) writes ... ]

 
 > I'm trying to write a GEM application, and I'd like to use keyboard 
 > equivalents for menu item selection.  How is this done? I see keyboard
 > equivalents mentioned in the docs, but how do I add them to the resource
 > file? And how does the application know that a keypress is a menu equivalent?
 > Is there some AES function that will tell you if a keypress is a menu
 > shortcut?  Any help would be appreciated...

Unless I'm doing it all wrong, you call evnt_multi() and look at the
returned value to determine whether you've received a menu message,
a keystroke, or whatever. Then you either evaluate the contents of
the message buffer or look at the keystroke values, as appropriate.
(This is why GEM programs wind up with such hellishly long sequences of
nested switch-case statements.)

All the resource file does is describe objects to be drawn. The convention
for indicating that there is an ALT key alias for a menu function is that
little doohickey that looks like a reverse-video gunsight, but I don't
recall what control-keystroke produces it.

 ----
 Steve Yelvington, Marine on St. Croix, Minnesota, USA / steve@thelake.mn.org