def insertChar(self, c, fg=1, bg=0, frange=None, x=None, y=None, moveCursor = False, pushUndo=True):
        """ insert character at current location, move cursor to the right (unless at the edge of canvas) """
        if pushUndo:    # push onto the clipboard stack
            self.undo.push()
        if x == None:
            x = self.xy[1]
            moveCursor = True
        if y == None:
            y = self.xy[0]
        if frange: # frame range
            for fn in range(frange[0] - 1, frange[1]):
                try:
                    self.mov.frames[fn].content[y][x - 1] = chr(c)
                    #self.mov.frames[fn].colorMap.update(
                    #        {(y,x - 1):(fg,bg)} )
                    self.mov.frames[fn].newColorMap[y][x - 1] = [fg, bg]
                except Exception as E:
                    self.notify(f"There was an internal error: {E}", pause=True)
                    self.notify(f"Frame: {fn}, x: {x}, y: {y}, fg: {fg}, bg: {bg}")
                    self.notify(f"Please save your work and restart Durdraw. Sorry for the inconvenience.")
                    break
            if x < self.mov.sizeX and moveCursor:
                self.move_cursor_right()
                #self.xy[1] = self.xy[1] + 1 
        else:
            self.mov.currentFrame.content[y][x - 1] = chr(c)
            #self.mov.currentFrame.colorMap.update(
            #        {(y,x - 1):(fg,bg)} )
            self.mov.currentFrame.newColorMap[y][x - 1] = [fg, bg]
            if x < self.mov.sizeX and moveCursor:
                self.move_cursor_right()
                #self.xy[1] = self.xy[1] + 1 
 insert character at current location, move cursor to the right (unless at the edge of canvas) 
durdraw/durdraw_ui_curses.py