code: def update(self, events, time_passed=None):
          
          for e in events:
              if e.type == pygame.QUIT:
                  raise SystemExit
  
              if e.type == pygame.KEYDOWN:
                  if e.key == pygame.K_ESCAPE:
                      raise SystemExit
                  if e.key == pygame.K_DOWN:
                      self.option += 1
                  if e.key == pygame.K_UP:
                      self.option -= 1
                  if e.key == pygame.K_RETURN or e.key == pygame.K_SPACE:
                      self.options[self.option]['callable']()
              # Mouse controls
              elif e.type == pygame.MOUSEBUTTONDOWN:
                  lb, cb, rb = pygame.mouse.get_pressed()
                  if lb:
                      self.options[self.option]['callable']()
          # Menu limits
          if self.option > len(self.options) - 1:
              self.option = len(self.options) - 1
          elif self.option < 0:
              self.option = 0
          # Check for mouse position
          if self.mouse_enabled:
              self._checkMousePositionForFocus()
          if time_passed:
              self._updateEffects(time_passed)
docs: Update the menu and get input for the menu.
  
          @events: the pygame catched events
          @time_passed: delta time since the last call