I've posted this question on the fmforums.org boards as well, but hope
somebody on the usenet forum might be able to help.


I am making a FP5.5 solution, containing a quiz with 25 questions,
that the user needs to answer with a Yes or a No.
I have made the corresponding scripts, attatched them to, and placed
corresponding Y/N buttons on the layout.

What I also would like to do is to let the user answer by pressing the
Y or the N key on the keyboard, if they chose not to use the mouse.

The only (un-elegant IMHO) solution i've managed to do, is the
following script:


Allow User Abort("Off")
Set Field("keyinput","")
Loop
If("keyinput = "y" or keyinput = "Y" or keyinput = "n" or keyinput
= "N"")
Perform Script ("Next_Question")
Exit Script
End If
If("keyinput <> "j" or keyinput <> "J" or keyinput <> "n" or
keyinput <> "N" or keyinput <>""")
Set Field("keyinput","")
End If
Goto Field("keyinput")
Pause/Resume Script("0:00:01")
End Loop

The field keyinput is a global Text field, which has been hidden on
the layout with a size of height 1 and width 1, and font size 1 point.

I need the global as a "flag", for the Next_Question script to do
various stuff depending on a Yes or a No answer.
I don't need the answer displayed on the layout where the quiz is
taking place, as all 25 answers are stored and checked at the end of
the Next_Question script, when the question counter has reached 25.

I was wondering if anybody have an easier and better solution to the
problem of allowing the user to respond via the keyboard, as well as
via clicking on a button.

Is there any plugins which could execute a script upon a keypress, as
the 50 times pr second check of an event, would generate a much more
pleasant and fluid user experience, than the "lag" of 1 second
involved in the above script ?

The problem for me, is that the loop used in my above script is slow
and only checks for the users input once every second. What I was
hoping for was a solution with a "finer grained" timing, than possible
with the Pause/Resume script step.

Things would have been so much easier if we could attach a key to a
button. For instance by labeling the buttons &Yes and &No, where the
character following the ampersand would define the key to be pressed,
in order to execute the script attached to the button.

Filemaker could have implemented that either like I just described or
by giving us the possibility to attach a key to the button in the
Button definition dialog. Would have made a mouse and keyboard driven
user-interface so much easier to accomplish.

Any ideas are welcome.

B. Regards

Johds