      def main(self, events, mousepos, id):         for event in events:             if event.type == pygame.QUIT:                 exit()             if event.type == pygame.MOUSEBUTTONDOWN:                 self.pressed = False                 if self.rect(id, mousepos):                     self.pressed = True                          if event.type == pygame.KEYDOWN:                 if event.key == pygame.K_a:                     if self.pressed:                         print("reached")                                                  self.dict_text[id] = []                         self.dict_text[id].append("a")                         self.surface.blit(self.font.render(f'{str(self.dict_text[id])}', self.antialias, (0, 0, 0)),                                             (self.x, self.y))                     else:                         print("didn't")  