The car script
Karl Ramberg
karl.ramberg at chello.se
Thu Jul 25 18:40:21 UTC 2002
Ned Konz wrote:
>
> On Thursday 25 July 2002 09:45 am, Ned Konz wrote:
>
> > I seem to have dealt with this at one point for someone, though I
> > don't remember what I did. See:
>
> Sorry, I wasn't thinking. Integrating keyboard response with eToy
> scripting is an interesting problem, though.
>
> I *think* what I'd do is to add another script trigger ("key
> pressed"), and maybe also a "key released" one.
>
> And then provide a Morph property getter for the last keyboard event,
> or maybe tests for what it was.
>
> As in, maybe,
>
> aMorph wasLastKeyUp: '<right>'
> aMorph wasLastKeyDown: 'd'
>
> (of course, as tests on the Player).
>
> I'd rather not introduce another eToy data type, because it's too much
> work. However, this is probably the best way to do the job from a UI
> perspective because rather than having to type in text to specify
> keys, you could just type a key (and specify up/down as well).
The thingy I did looks for the ASKII number of the key, it also
give you the key number in the playfield key pressed player category.
Having a key type would be nice though.
Karl
More information about the Squeak-dev
mailing list
|