code: def process_keys(self):
          
          while self.input_queue:
              key_press = self.input_queue.popleft()
  
              if key_press.key != Keys.CPRResponse:
                  self.beforeKeyPress.fire()
  
              self._process_coroutine.send(key_press)
  
              if key_press.key != Keys.CPRResponse:
                  self.afterKeyPress.fire()
  
          # Invalidate user interface.
          cli = self._cli_ref()
          if cli:
              cli.invalidate()
docs: Process all the keys in the `input_queue`.
          (To be called after `feed`.)
  
          Note: because of the `feed`/`process_keys` separation, it is
                possible to call `feed` from inside a key binding.
                This function keeps looping until the queue is empty.