[comp.sys.mac.hypercard] Wanted: a fun stack for a 1-year-old

day@grand.UUCP (Dave Yost) (02/13/89)

My baby loves to play with the keyboard and the mouse.
She needs something really simple to play with on the mac
where something interesting happens if she mouses over
this or that thingy on the screen or if she types a space
or a return or other characters.

Anyone have anything?

 --dave yost

casseres@Apple.COM (David Casseres) (02/15/89)

In article <479@grand.UUCP> day@grand.UUCP (Dave Yost) writes:
>My baby loves to play with the keyboard and the mouse.
>She needs something really simple to play with on the mac
>where something interesting happens if she mouses over
>this or that thingy on the screen or if she types a space
>or a return or other characters.

I've been wanting to do something like this but haven't been able to
figure out how to intercept keystrokes.  Anyone have a clue?

David Casseres

jdevoto@Apple.COM (Jeanne A. E. DeVoto) (02/15/89)

In article <671@internal.Apple.COM> casseres@Apple.COM (David Casseres) writes:
>In article <479@grand.UUCP> day@grand.UUCP (Dave Yost) writes:
>>My baby loves to play with the keyboard and the mouse.
>>She needs something really simple to play with on the mac
>
>I've been wanting to do something like this but haven't been able to
>figure out how to intercept keystrokes.  Anyone have a clue?

One way to do this kind of thing involves using the blindTyping property
(so anything the kid types goes into the message box) along with an
idle handler to check the contents of the message box (and beep, play
a song, flash, or do some other child-pleasing thing if the box contains
lets say a space). Of course,you take a performance hit from the idle
handler, but for a child's play stack of this type, I wouldn't think
that would make much difference.

on openStack
  global msgLoc, theLevel
  set the blindTyping to true
  put the userLevel into theLevel
  set the userLevel to 1
  put the loc of the message box into msgLoc
  set the loc of the message box to -20,200
end openStack

on idle
  if the message box is not empty then
    if the message box contains space then beep
    else if the message box contains "m" then flash 1 times
    [ etc ]
    put empty into the message box
  end if
end idle

on closeStack
  global msgLoc, theLevel
  set the userLevel to theLevel
  set the lock of the message box to msgLoc
end openStack

jeanne a. e. devoto
jdevoto@apple.com

annie@cs.swarthmore.edu (Annie Fetter) (02/15/89)

Reply to:  annie@cs.swarthmore.edu
Organization: Visual Geometry Project, Swarthmore College, PA
Keywords:  Inkey() XFCN

In article <671@internal.Apple.COM> casseres@Apple.COM (David Casseres) writes:
> In article <479@grand.UUCP> day@grand.UUCP (Dave Yost) writes:
> >My baby loves to play with the keyboard and the mouse.
> 
> I've been wanting to do something like this but haven't been able to
> figure out how to intercept keystrokes.  Anyone have a clue?
> 
> David Casseres

There is an XFCN called Inkey which will do just that.  It is available just
about anywhere (I don't remember where I got it) but if you can't find it, send
me a note and I'll mail you a copy.  A sample use would look like this

	on idle
		get Inkey()
		if it is "yes" then scream, yell, and jump up and down
		else doMenu "Quit Hypercard"
	end idle

goodLuck!
	-Annie




-- 
       Annie Fetter           |      annie@cs.swarthmore.edu    |  "We got the
VGP-Department of Mathematics |      fetter@swarthmr.bitnet     |   grant! We
    Swarthmore College        |  ...!rutgers!bpa!swatsun!annie  |    Open the
   Swarthmore, PA 19081       |         (215) 328-8225          |   champagne!"