code: def activate_next(self, _previous=False):
          
          current = self.get_current_value()
          options = sorted(self.values.keys())
  
          # Get current index.
          try:
              index = options.index(current)
          except ValueError:
              index = 0
  
          # Go to previous/next index.
          if _previous:
              index -= 1
          else:
              index += 1
  
          # Call handler for this option.
          next_option = options[index % len(options)]
          self.values[next_option]()
docs: Activate next value.