def getch(self):
c = self.getbyt()
if c is None:
return None
#print self.getbyt_avail()
if self.posix:
# for posix, keep possing input until have a full, valid escape code.
while self.is_escape_code(c)<0:
n = self.getbyt()
if n is None:
break
c = c+n
if self.is_escape_code(c)<1:
self.ungetbyt(c[1:])
c = c[0]
else:
# for windows, get another byte if an extended symbol, then map.
if c=='\xE0' or c=='\x00':
n = self.getbyt()
if n is not None:
c = c+n
# mapping from windows-dosbox inputs to posix-terminal inputs
if c in self._winmap:
c = self._winmap[c]
return c
评论列表
文章目录