本文整理汇总了Python中curses.flushinp方法的典型用法代码示例。如果您正苦于以下问题:Python curses.flushinp方法的具体用法?Python curses.flushinp怎么用?Python curses.flushinp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类curses
的用法示例。
在下文中一共展示了curses.flushinp方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: edit
# 需要导入模块: import curses [as 别名]
# 或者: from curses import flushinp [as 别名]
def edit(self):
self.editing = True
self.how_exited = None
# if self.value: self.cursor_line = self.value
self.display()
while self.editing:
self.get_and_use_key_press()
self.update(clear=None)
## self.clear()
## self.update(clear=False)
self.parent.refresh()
## curses.napms(10)
## curses.flushinp()
示例2: notify_wait
# 需要导入模块: import curses [as 别名]
# 或者: from curses import flushinp [as 别名]
def notify_wait(*args, **keywords):
notify(*args, **keywords)
curses.napms(3000)
curses.flushinp()
示例3: h_display_help
# 需要导入模块: import curses [as 别名]
# 或者: from curses import flushinp [as 别名]
def h_display_help(self, input):
if self.help == None: return
if self.name:
help_name="%s Help" %(self.name)
else: help_name=None
curses.flushinp()
util_viewhelp.view_help(self.help, title=help_name, autowrap=self.WRAP_HELP)
#select.ViewText(self.help, name=help_name)
self.display()
return True
示例4: main
# 需要导入模块: import curses [as 别名]
# 或者: from curses import flushinp [as 别名]
def main(screen):
init_curses(screen)
game_map = Map("map1")
player = Player(game_map)
textures = ["wall1", "wall2", "dragon", "tree"]
Controller(Renderer(screen, player, textures)).start()
curses.flushinp()
curses.endwin()
示例5: edit
# 需要导入模块: import curses [as 别名]
# 或者: from curses import flushinp [as 别名]
def edit(self):
self.editing = True
self.how_exited = None
#if self.value: self.cursor_line = self.value
self.display()
while self.editing:
self.get_and_use_key_press()
self.update(clear=None)
## self.clear()
## self.update(clear=False)
self.parent.refresh()
## curses.napms(10)
## curses.flushinp()
示例6: get_and_use_key_press
# 需要导入模块: import curses [as 别名]
# 或者: from curses import flushinp [as 别名]
def get_and_use_key_press(self):
global TEST_SETTINGS
if (TEST_SETTINGS['TEST_INPUT'] is None) and (TEST_SETTINGS['INPUT_GENERATOR'] is None):
curses.raw()
curses.cbreak()
curses.meta(1)
self.parent.curses_pad.keypad(1)
if self.parent.keypress_timeout:
curses.halfdelay(self.parent.keypress_timeout)
ch = self._get_ch()
if ch == -1:
return self.try_while_waiting()
else:
self.parent.curses_pad.timeout(-1)
ch = self._get_ch()
# handle escape-prefixed rubbish.
if ch == curses.ascii.ESC:
#self.parent.curses_pad.timeout(1)
self.parent.curses_pad.nodelay(1)
ch2 = self.parent.curses_pad.getch()
if ch2 != -1:
ch = curses.ascii.alt(ch2)
self.parent.curses_pad.timeout(-1) # back to blocking mode
#curses.flushinp()
elif (TEST_SETTINGS['INPUT_GENERATOR']):
self._last_get_ch_was_unicode = True
try:
ch = next(TEST_SETTINGS['INPUT_GENERATOR'])
except StopIteration:
if TEST_SETTINGS['CONTINUE_AFTER_TEST_INPUT']:
TEST_SETTINGS['INPUT_GENERATOR'] = None
return
else:
raise ExhaustedTestInput
else:
self._last_get_ch_was_unicode = True
try:
ch = TEST_SETTINGS['TEST_INPUT'].pop(0)
TEST_SETTINGS['TEST_INPUT_LOG'].append(ch)
except IndexError:
if TEST_SETTINGS['CONTINUE_AFTER_TEST_INPUT']:
TEST_SETTINGS['TEST_INPUT'] = None
return
else:
raise ExhaustedTestInput
self.handle_input(ch)
if self.check_value_change:
self.when_check_value_changed()
if self.check_cursor_move:
self.when_check_cursor_moved()
self.try_adjust_widgets()