def METHOD_NAME(self, e) -> None:
    """Returns True if shutting down"""
    assert self.in_prompt or self.in_confirm or self.waiting_for_refresh
    if isinstance(e, RefreshRequestEvent):
        self.waiting_for_refresh = False
        self.request_context.switch()
    elif isinstance(e, events.PasteEvent):
        for ee in e.events:
            # strip control seq
            self.add_normal_character(ee if len(ee) == 1 else ee[-1])
    elif e == "<ESC>" or isinstance(e, events.SigIntEvent):
        self.request_context.switch(False)
        self.escape()
    elif e in edit_keys:
        self.cursor_offset_in_line, self._current_line = edit_keys[e](
            self.cursor_offset_in_line, self._current_line
        )
    elif e == "<Ctrl-c>":  # TODO can this be removed?
        raise KeyboardInterrupt()
    elif e == "<Ctrl-d>":  # TODO this isn't a very intuitive behavior
        raise SystemExit()
    elif self.in_prompt and e in ("\n", "\r", "<Ctrl-j>", "Ctrl-m>"):
        line = self._current_line
        self.escape()
        self.request_context.switch(line)
    elif self.in_confirm:
        if e.lower() == _("y"):
            self.request_context.switch(True)
        else:
            self.request_context.switch(False)
        self.escape()
    else:  # add normal character
        self.add_normal_character(e)