Check if a set of events occur in a limited time period
Here's some pseudocode that might help:

   if millis() - start time &gt;= 2000
         time is up, do what you want with the sequence so far
         maybe a boolean flag here so you only do it once
   if any button is pressed
      if counter == 0
          set start time = millis() // start the timer
          set first in sequence
      else 
          add the button to the sequence