def waitKeys(maxWait=float('inf'), keyList=None, modifiers=False, timeStamped=False):
 key = None
 clearEvents('keyboard')
 timer = psychopy.core.Clock()
 while ((key is None) and (timer.getTime() < maxWait)):
  if havePyglet:
   defDisplay = pyglet.window.get_platform().get_default_display()
   for win in defDisplay.get_windows():
    win.dispatch_events()
  keys = getKeys(keyList=keyList, modifiers=modifiers, timeStamped=timeStamped)
  if len(keys):
   return keys
 logging.data('No keypress (maxWait exceeded)')
 return None

def waitKeys ( maxWait = float ( 'inf' ) , keyList = None , modifiers = False , timeStamped = False ) : key = None clearEvents ( 'keyboard' ) timer = psychopy . core . Clock ( ) while ( ( key is None ) and ( timer . getTime ( ) < maxWait ) ) : if havePyglet : defDisplay = pyglet . window . get_platform ( ) . get_default_display ( ) for win in defDisplay . get_windows ( ) : win . dispatch_events ( ) keys = getKeys ( keyList = keyList , modifiers = modifiers , timeStamped = timeStamped ) if len ( keys ) : return keys logging . data ( 'No keypress (maxWait exceeded)' ) return None
same as ~psychopy .