

def _drawinputcursor(self):
    'Draws the input cursor directly onto the self._surfaceobj Surface object, if self._inputcursormode is not None.'
    if ((self._inputcursormode is not None) and (self._inputcursorx is not None) and (self._inputcursory is not None)):
        x = self._inputcursorx
        y = self._inputcursory
        current_time = datetime.datetime.now()
        microseconds = ((current_time.second * (10 ** 6)) + current_time.microsecond)
        if ((not self.inputcursorblinking) or (((microseconds // 1000) // self.inputcursorblinkspeed) % 2)):
            (cellfgcolor, cellbgcolor) = self.getdisplayedcolors(x, y)
            if (self._inputcursormode == 'underline'):
                pygame.draw.rect(self._surfaceobj, cellfgcolor, (((self._cellwidth * x) + 2), ((self._cellheight * (y + 1)) - 3), (self._cellwidth - 4), 3))
            elif (self._inputcursormode == 'insert'):
                pygame.draw.rect(self._surfaceobj, cellfgcolor, (((self._cellwidth * x) + 2), ((self._cellheight * (y + 1)) - int((self._cellheight / 2.5))), (self._cellwidth - 4), int((self._cellheight / 2.5))))
            elif (self._inputcursormode == 'box'):
                cellrect = pygame.Rect((self._cellwidth * x), (self._cellheight * y), self._cellwidth, self._cellheight)
                self._surfaceobj.fill(cellfgcolor, cellrect)
                charsurf = self._font.render(self._screenchar[x][y], 1, cellbgcolor, cellfgcolor)
                charrect = charsurf.get_rect()
                charrect.centerx = ((self._cellwidth * x) + int((self._cellwidth / 2)))
                charrect.bottom = (self._cellheight * (y + 1))
                self._surfaceobj.blit(charsurf, charrect)
        else:
            self._repaintcell(x, y)

dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py PygcurseSurface._drawinputcursor/original