本文整理汇总了Python中curses.KEY_F1属性的典型用法代码示例。如果您正苦于以下问题:Python curses.KEY_F1属性的具体用法?Python curses.KEY_F1怎么用?Python curses.KEY_F1使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类curses
的用法示例。
在下文中一共展示了curses.KEY_F1属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: beforeEditing
# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_F1 [as 别名]
def beforeEditing(self):
self.parentApp.my_counter = 0
self.add_handlers({curses.KEY_F1: self.display_help})
self.add(npyscreen.MultiLineEdit, value='=' * (self.columns - 4), max_height=1, rely=self.lines-4, editable=False)
self.marketing_label = self.add(npyscreen.MultiLineEdit, value='', max_height=1, rely=self.lines-3, editable=False)
form_name = getClassName(self)
if form_name != 'InstallStepsForm':
next_x = 20 if form_name == 'MAIN' else 28
self.button_next = self.add(npyscreen.ButtonPress, name="Next", when_pressed_function=self.nextButtonPressed, rely=self.lines-5, relx=self.columns - next_x)
if next_x == 28:
self.button_back = self.add(npyscreen.ButtonPress, name="Back", when_pressed_function=self.backButtonPressed, rely=self.lines-5, relx=self.columns - 20)
self.button_quit = self.add(npyscreen.ButtonPress, name="Quit", when_pressed_function=self.quitButtonPressed, rely=self.lines-5, relx=self.columns - 12)
if hasattr(self, 'do_beforeEditing'):
self.do_beforeEditing()
示例2: create
# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_F1 [as 别名]
def create(self):
self.name = 'Dictionary Browser \xe2\x94\x80\xe2\x94\x80 (Press F1 for help)'
self.add_handlers({curses.KEY_F1: self.usage,
ord('/'): self.search,
ord('f'): self.filter,
ord('r'): self.reset,
ord('q'): self.quit})
self.items = self.add(npyscreen.TitleText, name='Items total', value='0', editable=False)
self.add(npyscreen.TitleText, name='PS version', value='3010', editable=False)
self.search_btn = self.add(SearchButton, relx=33, rely=2, name='Search')
self.search_text = self.add(npyscreen.FixedText, relx=53, rely=2, editable=False)
self.filter_btn = self.add(FilterButton, relx=33, rely=3, name='Filter')
self.filter_text = self.add(npyscreen.FixedText, relx=53, rely=3, editable=False)
self.dict = self.add(Dict, name='Dictionary', scroll_exit=True, max_width=43, relx=2, rely=5, max_height=-2)
self.perms = self.add(Perms, name='Permissions', scroll_exit=True, rely=5, relx=46, max_height=6)
self.value = self.add(Value, name='Edit Value', scroll_exit=True, rely=11, relx=46, max_height=-2)
self.status = self.add(npyscreen.TitleText, name='Status', editable=False, value='Connected to laserjet.lan', rely=-3)
self.save = self.add(npyscreen.ButtonPress, name='Save Changes', rely=-3, relx=-27)
self.exit = self.add(npyscreen.ButtonPress, name='Exit', rely=-3, relx=-12)
self.save.whenPressed = self.commit
self.exit.whenPressed = self.quit
self.update_dict()
示例3: set_up_handlers
# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_F1 [as 别名]
def set_up_handlers(self):
self.complex_handlers = []
self.handlers = {
curses.KEY_F1: self.h_display_help,
"KEY_F(1)": self.h_display_help,
"^O": self.h_display_help,
"^L": self.h_display,
curses.KEY_RESIZE: self._resize,
}
示例4: define_keys
# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_F1 [as 别名]
def define_keys(self):
self.keys = {'j': self.down,
'k': self.up,
'h': self.left,
'l': self.right,
'J': self.page_down,
'K': self.page_up,
'm': self.mark,
"'": self.goto_mark,
'L': self.page_right,
'H': self.page_left,
'q': self.quit,
'Q': self.quit,
'$': self.line_end,
'^': self.line_home,
'0': self.line_home,
'g': self.home,
'G': self.goto_row,
'|': self.goto_col,
'\n': self.show_cell,
'/': self.search,
'n': self.search_results,
'p': self.search_results_prev,
't': self.toggle_header,
'-': self.column_gap_down,
'+': self.column_gap_up,
'<': self.column_width_all_down,
'>': self.column_width_all_up,
',': self.column_width_down,
'.': self.column_width_up,
'a': self.sort_by_column_natural,
'A': self.sort_by_column_natural_reverse,
's': self.sort_by_column,
'S': self.sort_by_column_reverse,
'y': self.yank_cell,
'r': self.reload,
'c': self.toggle_column_width,
'C': self.set_current_column_width,
']': self.skip_to_row_change,
'[': self.skip_to_row_change_reverse,
'}': self.skip_to_col_change,
'{': self.skip_to_col_change_reverse,
'?': self.help,
curses.KEY_F1: self.help,
curses.KEY_UP: self.up,
curses.KEY_DOWN: self.down,
curses.KEY_LEFT: self.left,
curses.KEY_RIGHT: self.right,
curses.KEY_HOME: self.line_home,
curses.KEY_END: self.line_end,
curses.KEY_PPAGE: self.page_up,
curses.KEY_NPAGE: self.page_down,
curses.KEY_IC: self.mark,
curses.KEY_DC: self.goto_mark,
curses.KEY_ENTER: self.show_cell,
KEY_CTRL('a'): self.line_home,
KEY_CTRL('e'): self.line_end,
}