RE: disabling keypresses

Mark Randell (mark@psy.uwa.edu.au)
Fri, 11 Apr 1997 08:25:04 +0800

From: barney <barney@visicom.com>
How can I fix it so MetaCard recognizes one button click, then disables
that button until the next time I want the user to click on it. Is there
such a command as enable/disable button function?
--=20
From: Scott Raney <raney@metacard.com>
The only way I can think to get around this is to use
"send .. in" to send a message after all the queued events have been
processed. =20

----------------------
We ran across this problem in designing reaction time experiments where =
we needed to record a keypress, then disable keypresses until another =
set of experimental stimulii (words/pictures) were presented. The =
solution I adopted was essentially that proposed by Scott, with the =
addition of a 'switch' variable that was set to 1 after the first =
keypress and then caused the 'keyDown' handler to exit until the switch =
was reset to 0 by a delayed send command.
ie. =20
on keyDown which
global mySwitch
if mySwitch =3D 1 then
exit keyDown
else
(do stuff)
send mouseUp to btn 1 in 60 seconds
end if
end keyDown

btn 1:
on mouseUp
global mySwitch
-- enable keypresses
set mySwitch to 0
-- (call the main handler again)
end mouseUp

\m
-------------------------------------------------------------------------=

mark randell cognitive science programme
tel +61 9 380 3266 university of western australia
fax +61 9 380 1006 perth wa australia 6097
-------------------------------------------------------------------------=

http://babelfish.psy.uwa.edu.au/home.html
-------------------------------------------------------------------------=