def ProcessMotion(vf_time):
 last_pos = None
 for event in pygame.event.get():
  if ((event.type == pygame.QUIT) or (event.type == pygame.KEYDOWN)):
   return sys.exit(0)
  if vf_time.IsActive():
   if (event.type == pygame.MOUSEMOTION):
    if event.buttons[0]:
     last_pos = event.pos
   elif (event.type == pygame.MOUSEBUTTONUP):
    if (event.button == 1):
     vf_time.Stop()
  elif (event.type == pygame.MOUSEBUTTONDOWN):
   if (event.button == 1):
    pos = PixelsToDimensions(event.pos)
    (x, y) = pos
    if ((x > ((iphone_dims[0] - target_box_width) - target_box_padding)) and (x < (iphone_dims[0] - target_box_padding)) and (y > target_box_padding) and (y < (iphone_dims[1] - target_box_padding))):
     vf_time.Start(pos)
 if last_pos:
  vf_time.AdjustTime(PixelsToDimensions(last_pos))

def ProcessMotion ( vf_time ) : last_pos = None for event in pygame . event . get ( ) : if ( ( event . type == pygame . QUIT ) or ( event . type == pygame . KEYDOWN ) ) : return sys . exit ( 0 ) if vf_time . IsActive ( ) : if ( event . type == pygame . MOUSEMOTION ) : if event . buttons [ 0 ] : last_pos = event . pos elif ( event . type == pygame . MOUSEBUTTONUP ) : if ( event . button == 1 ) : vf_time . Stop ( ) elif ( event . type == pygame . MOUSEBUTTONDOWN ) : if ( event . button == 1 ) : pos = PixelsToDimensions ( event . pos ) ( x , y ) = pos if ( ( x > ( ( iphone_dims [ 0 ] - target_box_width ) - target_box_padding ) ) and ( x < ( iphone_dims [ 0 ] - target_box_padding ) ) and ( y > target_box_padding ) and ( y < ( iphone_dims [ 1 ] - target_box_padding ) ) ) : vf_time . Start ( pos ) if last_pos : vf_time . AdjustTime ( PixelsToDimensions ( last_pos ) )
process pygame events for the window .