 def main(self, events, mousepos, id):     for event in events:         if event.type == pygame.QUIT:             exit()         if event.type == pygame.MOUSEBUTTONDOWN:             if self.rect(id, mousepos):                 if event.type == pygame.KEYDOWN:                     