John Kiltinen <[EMAIL PROTECTED]> wrote:
> Upon further experimentation with another answer dialog that offers buttons
> with the choices "Endgame", "Complete", and "Buttons", I found that a
> virtual press on these buttons is gotten by pressing the e, c, and b keys
> respectively. Apparently the first letter of the option is enough. The
> key can be depressed as the answer dialog is opened or can be pressed after
> it is open.
> I've found no mention of this behavior in the MetaCard reference. Is this
> an undocumented feature, or have I discovered an unintended hack?
This is standard Windows and Motif behavior: the underlined character (the
mnemonic) specifies what button will be activated when you press that character
when no field has the keyboard focus. It is indeed an undocumented feature
that this also works in the MacOS look and feel. I wouldn't count on this
behavior, though: if people start reporting it as a bug (and they haven't so
far), it could change.
> My question: Is there a better way to do what I am trying to do here.
> Does anyone see any pitfalls with this approach? (I am nervous because I
> find nothing in the documentation that this is how autoArm is supposed to
> work for a button.)
My first reaction would be yes: you probably should be using an option menu
for this choice instead of opening a dialog. UI hacks like having people
hold keys down to change the behavior are just bound to get you in trouble
at some point, even if you do only plan to document them for the expert user
(e.g., some non-expert user will undoubtedly run into it and file a bug report
about this unexpected behavior). A group of radio buttons or a list box could
also be used for this. And never open dialogs one after another for a common
operation: make one dialog with all the settings for that operation in it
instead.
There is a way to solve your problem, though, if you insist on experimenting:
handle the rawKeyDown message in a frontScript and check the target as the first
step in the handler. If it's one you know how to deal with, do your thing.
Otherwise "pass rawKeyDown".
Regards,
Scott
--
********************************************************
Scott Raney [EMAIL PROTECTED] http://www.metacard.com
MetaCard: You know, there's an easier way to do that...
Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.