[comp.sys.mac.hypercard] capturing keystrokes and stacks for children

moore@cs.washington.edu (Charles Moore) (01/23/90)

A friend of mine is trying to capture individual keystrokes in HyperCard
so that he can make his Mac do interesting things (mostly play sounds) 
when his 18-month-old son pounds on the keyboard.  He would like to be
able to program specific keys to do specific things and thus needs a
function like "keyPressed" that he could use in "if" statements like:

put keyPressed into key
if key = "a" then
  play "boing"
else
  if key = "b" then
    ...

If anybody knows of any good way of doing something like this in HyperTalk,
please let me know.  Alternatively, does anybody out there have an XFNC that
performs the function of "keyPressed"?

Finally, are there any stacks out there that are fun for little kids to 
play with?  We'd be particularly interested in anything that makes noise.

Thanks,

Charles Moore

annie@cs.swarthmore.edu (Annie Fetter) (02/01/90)

dave@lsuc.on.ca (David Sherman) writes:
> In article <10464@june.cs.washington.edu> moore@cs.washington.edu (Charles Moore) writes:
> >
> >A friend of mine is trying to capture individual keystrokes in HyperCard
> >so that he can make his Mac do interesting things (mostly play sounds) 
> >when his 18-month-old son pounds on the keyboard.  He would like to be
> { uunet!attcan  att  utzoo }!lsuc!dave          dave@lsuc.on.ca

A while back I posted a stack which uses an XCMD called "Inkey" which does
just what you want - remember Basic and Inkey$?  It will take individual inputs
and do whatever you want with them.  I have used it for paging through indexes,
field searches, and educational stacks I've written.

Anyway, if you want a copy of it, send me mail at one of the addresses below.
If there are sufficient responses in the next couple of days, I'll post it
again.

Happy Scripting!

	-Annie

PS:  To the person who requested my multi-scrolling fields script:  it's on
it's way!


-- 
 OOO   L    MM   MM   OOO                  *    Annie Fetter, Resident Jock
O   O  L    M M M M  O   O  It's the only  *      Visual Geometry Project
O   O  L    M  M  M  O   O   way to fly!   *      annie@cs.swarthmore.edu
 OOO   LLLL M     M   OOO                  *  ...rutgers!bpa!swatsun!annie