In reply to my inquiry about which key is down when a keyDown message is
sent, "Monte Goulding" <[EMAIL PROTECTED]> wrote:
>I'm not quite sure that this is the answer you want but the keydown handler
>has a parameter that is the key pressed. on keydown x will put the key
>pressed into x
Bingo!! Thanks, Monte. I knew this was an easy question. I just did not
know MetaCard's syntax for passing parameters (arguments) with messages.
It is frustrating that little details like this are so hard to find in
MetaCard's documentation.
I have now worked out a strategy for coordinating keyDown and mouseUp
handlers in the script for this button that gets the job done. (I found
that I needed to move the letter into another global variable to pass it
from the keyDown handler to the mouseUp handler as the variable "x" used to
receive the letter did not seem to work for this purpose.)
John Kiltinen
My original question:
>> I have a button on a stack which, when pressed, opens an answer dialog
>> offering the user three options, "A", "B", or "C". I would like to speed
>> up the process by allowing the experienced user to bypass the dialog by
>> holding down the key for one of these letters on the keyboard while
>> pressing the button, which will result in going directly to the chosen
>> option.
>>
>> Surely this is easily done, but I can't figure out how. I've experimented
>> with the keyDown message, but holding a key down for awhile sends multiple
>> copies of this message, analogous to getting repeated a's while
>> holding the
>> "a" key down when typing. This will complicate matters.
>>
>> I've noted that while a button does not normally accept the
>> keyboard focus,
>> if its autoarm property is set to true, it will. Thus, a keyDown message
>> could be sent to the button. But my problem is that I haven't found the
>> secret of telling WHICH key is down. (There ought to be a function that
>> gives this information, but what is it?)
>>
>> Assuming I can tell which key is down, will there be any problem
>> coordinating the processing of keyDown and mouseUp messages by
>> the handlers
>> for this button?
>>
>> This ought to be an easy exercise for anyone who knows MetaCard well.
>> Help, anyone?
>>
>> John Kiltinen
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
John Kiltinen ([EMAIL PROTECTED]) Home Office
Professor, Dept. of Math. & CS Tel.(906) 228-8035 or (906) 227-1600
Northern Michigan University Fax (906) 228-4667 or (906) 2272010
Marquette, MI 49855 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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.