当前位置: 首页>>代码示例>>Python>>正文


Python curses.flushinp方法代码示例

本文整理汇总了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() 
开发者ID:hexway,项目名称:apple_bleee,代码行数:17,代码来源:wgmultiline.py

示例2: notify_wait

# 需要导入模块: import curses [as 别名]
# 或者: from curses import flushinp [as 别名]
def notify_wait(*args, **keywords):
    notify(*args, **keywords)
    curses.napms(3000)
    curses.flushinp() 
开发者ID:hexway,项目名称:apple_bleee,代码行数:6,代码来源:utilNotify.py

示例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 
开发者ID:hexway,项目名称:apple_bleee,代码行数:12,代码来源:fmForm.py

示例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() 
开发者ID:salt-die,项目名称:terminal_dungeon,代码行数:13,代码来源:terminal_dungeon.py

示例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() 
开发者ID:sealingtech,项目名称:EDCOP,代码行数:15,代码来源:wgmultiline.py

示例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() 
开发者ID:hexway,项目名称:apple_bleee,代码行数:56,代码来源:wgwidget.py


注:本文中的curses.flushinp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。