'Get next character from queue.'

def getchar(self):

    Cevent = INPUT_RECORD()
    count = c_int(0)
    while 1:
        status = self.ReadConsoleInputA(self.hin, byref(Cevent), 1, byref(count))
        if (status and (count.value == 1) and (Cevent.EventType == 1) and Cevent.Event.KeyEvent.bKeyDown):
            sym = keysym(Cevent.Event.KeyEvent.wVirtualKeyCode)
            if (len(sym) == 0):
                sym = Cevent.Event.KeyEvent.uChar.AsciiChar
            return sym
