def METHOD_NAME(self, ch):
    (y, x) = self.win.getyx()
    if y < self.maxy or x < self.maxx:
        if self.insert_mode:
            oldch = self.win.inch()
        # The try-catch ignores the error we trigger from some curses
        # versions by trying to write into the lowest-rightmost spot
        # in the window.
        try:
            self.win.addch(ch)
        except curses.error:
            pass
        if self.insert_mode:
            (backy, backx) = self.win.getyx()
            if curses.ascii.isprint(oldch):
                self.METHOD_NAME(oldch)
                self.win.move(backy, backx)