pressing mutiple keys using [key]


    Jun 16 2007 | 12:10 pm
    I am using a keyboard encoder and dance mat to create an interactive video.
    I have coded it to play different movies depending on what key is pressed on the mat. However i need to trigger videos to play not only if one key is pressed but if two keys are pressed together on the mat.(or at least pressed in close proximity 20-80ms)
    I am having difficulties figuring out the coding for this, i figure i have to find a way to time lenght between presses if they are within a certain amount append the key codes received to each other then send the new information on or if no second key is pressed send the single key code on.
    any help, advice, info would be extremely extremely appreciated!!!
    thank you..

    • Jun 16 2007 | 12:41 pm
      Is this what you want?
      The important object is thresh (gathers data into a list within a
      specified time period).
      max v2;
      Cheers
      Martin~
      On 16 Jun 2007, at 14:10, antoinette wrote:
      >
      > I am using a keyboard encoder and dance mat to create an
      > interactive video.
      >
      > I have coded it to play different movies depending on what key is
      > pressed on the mat. However i need to trigger videos to play not
      > only if one key is pressed but if two keys are pressed together on
      > the mat.(or at least pressed in close proximity 20-80ms)
      >
      > I am having difficulties figuring out the coding for this, i figure
      > i have to find a way to time lenght between presses if they are
      > within a certain amount append the key codes received to each other
      > then send the new information on or if no second key is pressed
      > send the single key code on.
      >
      > any help, advice, info would be extremely extremely appreciated!!!
      >
      > thank you..
    • Jun 16 2007 | 1:00 pm
      Check out [thresh] and [quickthresh] in the docs. It will be easy to do what you're after with either object - quickthresh just has some extra parameters for fine-tuning the timing conditions.
      J.
    • Jun 17 2007 | 3:58 am
      thank you.. that is exactly what i was after.. much simpler than i thought it would be.
      cheers.