[racket-dev] multiple key-press

From: Paul Ojanen (engineer at alum.mit.edu)
Date: Thu Jul 22 14:58:17 EDT 2010

A compromise exists...plug in another keyboard!  Their key-repeats won't
clobber each other like two keys on one keyboard do.  I think I've gone up
to four or five keyboards.  Don't worry, I do plan to introduce Universe
this year.

Holding down two different keys on two keyboards will generate nearly
perfect alternating key presses.  You have to trust the other player to not
push any of "your" keys.

This will solve your multi-player problem, but each player will still only
be able to effectively hold down one key at a time.  With the new
key-release, you can make efforts to detect multiple keys being held down in
Racket.  I actually had decent success but I can't find my demo file right
now.

**
Something else I've meant to spam the lists with was my use of Xbox
controllers in class.  I pay $10 for a convenient piece of software
(alternatively, freeware is available) that generates customizable key
presses from devices recognized as game controllers in Windows.  This is
less necessary with the upgrade to key-release, but still very cool.
Multiple key presses from my controllers "work" out of the box.  Kids love
to "test programs" using an Xbox controller.  I have three with me at Brown
this week, and I'll have them with me at NEU next week.
**

-Paul

> -----Original Message-----
> From: dev-bounces at racket-lang.org [mailto:dev-bounces at racket-lang.org] On
> Behalf Of Matthias Felleisen
> Sent: Thursday, July 22, 2010 9:32 AM
> To: Jay McCarthy
> Cc: PLT Developers
> Subject: Re: [racket-dev] multiple key-press
> 
> 
> I have considered this issue. I decided that these kinds of kids should be
> introduced to Universe programs as opposed to World programs. That's way
> cooler than silly one-keyboard games.
> 
> 
> 
> -- Matthias
> 
> 
> 
> 
> 
> On Jul 22, 2010, at 9:29 AM, Jay McCarthy wrote:
> 
> > As far as I know, at the lowest level there is no "multiple key press"
> > event even in the OS.
> >
> > If they want to do that, they should change their world to record the
> > "current key press state":
> >
> > (define-struct the-world (keys . everything-else))
> >
> > and at the start of `on-tick' look at the collective impact of all the
> > keys, resetting it to 'empty' when the new world is returned.
> >
> > That's more like how actually game engines work anyways.
> >
> > Jay
> >
> > On Thu, Jul 22, 2010 at 7:25 AM, Shriram Krishnamurthi <sk at cs.brown.edu>
> wrote:
> >> I just spoke with a room of high-school students studying Universe
> >> programming in a summer course at Brown.
> >>
> >> One major complaint was that they couldn't do multi-key-presses.  For
> >> instance, they want to use WASD navigation combined with a right-side
> >> key for firing, and want to be able to fire and navigate at the "same
> >> time".
> >>
> >> They've been using Shift, but the general consensus amongst the kids
> >> was this was Not Cool.  Basically, they felt like they were being
> >> cheated out of building a "real game".
> >>
> >> I don't know what it would take to support this.
> >>
> >> Shriram
> >> _________________________________________________
> >>  For list-related administrative tasks:
> >>  http://lists.racket-lang.org/listinfo/dev
> >>
> >
> >
> >
> > --
> > Jay McCarthy <jay at cs.byu.edu>
> > Assistant Professor / Brigham Young University
> > http://teammccarthy.org/jay
> >
> > "The glory of God is Intelligence" - D&C 93
> > _________________________________________________
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/dev
> 
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/dev



Posted on the dev mailing list.