Python curses.KEY_BTAB Examples
The following are 9
code examples of curses.KEY_BTAB().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
curses
, or try the search function
.
Example #1
Source File: wgwidget.py From apple_bleee with GNU General Public License v3.0 | 6 votes |
def set_up_handlers(self): """This function should be called somewhere during object initialisation (which all library-defined widgets do). You might like to override this in your own definition, but in most cases the add_handers or add_complex_handlers methods are what you want.""" #called in __init__ self.handlers = { curses.ascii.NL: self.h_exit_down, curses.ascii.CR: self.h_exit_down, curses.ascii.TAB: self.h_exit_down, curses.KEY_BTAB: self.h_exit_up, curses.KEY_DOWN: self.h_exit_down, curses.KEY_UP: self.h_exit_up, curses.KEY_LEFT: self.h_exit_left, curses.KEY_RIGHT: self.h_exit_right, # "^P": self.h_exit_up, # "^N": self.h_exit_down, curses.ascii.ESC: self.h_exit_escape, curses.KEY_MOUSE: self.h_exit_mouse, } self.complex_handlers = []
Example #2
Source File: wgwidget.py From HomePWN with GNU General Public License v3.0 | 6 votes |
def set_up_handlers(self): """This function should be called somewhere during object initialisation (which all library-defined widgets do). You might like to override this in your own definition, but in most cases the add_handers or add_complex_handlers methods are what you want.""" #called in __init__ self.handlers = { curses.ascii.NL: self.h_exit_down, curses.ascii.CR: self.h_exit_down, curses.ascii.TAB: self.h_exit_down, curses.KEY_BTAB: self.h_exit_up, curses.KEY_DOWN: self.h_exit_down, curses.KEY_UP: self.h_exit_up, curses.KEY_LEFT: self.h_exit_left, curses.KEY_RIGHT: self.h_exit_right, # "^P": self.h_exit_up, # "^N": self.h_exit_down, curses.ascii.ESC: self.h_exit_escape, curses.KEY_MOUSE: self.h_exit_mouse, } self.complex_handlers = []
Example #3
Source File: wgwidget.py From EDCOP with Apache License 2.0 | 6 votes |
def set_up_handlers(self): """This function should be called somewhere during object initialisation (which all library-defined widgets do). You might like to override this in your own definition, but in most cases the add_handers or add_complex_handlers methods are what you want.""" #called in __init__ self.handlers = { curses.ascii.NL: self.h_exit_down, curses.ascii.CR: self.h_exit_down, curses.ascii.TAB: self.h_exit_down, curses.KEY_BTAB: self.h_exit_up, curses.KEY_DOWN: self.h_exit_down, curses.KEY_UP: self.h_exit_up, curses.KEY_LEFT: self.h_exit_left, curses.KEY_RIGHT: self.h_exit_right, "^P": self.h_exit_up, "^N": self.h_exit_down, curses.ascii.ESC: self.h_exit_escape, curses.KEY_MOUSE: self.h_exit_mouse, } self.complex_handlers = []
Example #4
Source File: wgwidget.py From TelegramTUI with MIT License | 6 votes |
def set_up_handlers(self): """This function should be called somewhere during object initialisation (which all library-defined widgets do). You might like to override this in your own definition, but in most cases the add_handers or add_complex_handlers methods are what you want.""" #called in __init__ self.handlers = { curses.ascii.NL: self.h_exit_down, curses.ascii.CR: self.h_exit_down, curses.ascii.TAB: self.h_exit_down, curses.KEY_BTAB: self.h_exit_up, curses.KEY_DOWN: self.h_exit_down, curses.KEY_UP: self.h_exit_up, curses.KEY_LEFT: self.h_exit_left, curses.KEY_RIGHT: self.h_exit_right, # "^P": self.h_exit_up, # "^N": self.h_exit_down, curses.ascii.ESC: self.h_exit_escape, curses.KEY_MOUSE: self.h_exit_mouse, } self.complex_handlers = []
Example #5
Source File: wggrid.py From apple_bleee with GNU General Public License v3.0 | 5 votes |
def set_up_handlers(self): super(SimpleGrid, self).set_up_handlers() self.handlers = { curses.KEY_UP: self.h_move_line_up, curses.KEY_LEFT: self.h_move_cell_left, curses.KEY_DOWN: self.h_move_line_down, curses.KEY_RIGHT: self.h_move_cell_right, "k": self.h_move_line_up, "h": self.h_move_cell_left, "j": self.h_move_line_down, "l": self.h_move_cell_right, curses.KEY_NPAGE: self.h_move_page_down, curses.KEY_PPAGE: self.h_move_page_up, curses.KEY_HOME: self.h_show_beginning, curses.KEY_END: self.h_show_end, ord('g'): self.h_show_beginning, ord('G'): self.h_show_end, curses.ascii.TAB: self.h_exit, curses.KEY_BTAB: self.h_exit_up, '^P': self.h_exit_up, '^N': self.h_exit_down, #curses.ascii.NL: self.h_exit, #curses.ascii.SP: self.h_exit, #ord('x'): self.h_exit, ord('q'): self.h_exit, curses.ascii.ESC: self.h_exit, curses.KEY_MOUSE: self.h_exit_mouse, } self.complex_handlers = [ ]
Example #6
Source File: wggrid.py From HomePWN with GNU General Public License v3.0 | 5 votes |
def set_up_handlers(self): super(SimpleGrid, self).set_up_handlers() self.handlers = { curses.KEY_UP: self.h_move_line_up, curses.KEY_LEFT: self.h_move_cell_left, curses.KEY_DOWN: self.h_move_line_down, curses.KEY_RIGHT: self.h_move_cell_right, "k": self.h_move_line_up, "h": self.h_move_cell_left, "j": self.h_move_line_down, "l": self.h_move_cell_right, curses.KEY_NPAGE: self.h_move_page_down, curses.KEY_PPAGE: self.h_move_page_up, curses.KEY_HOME: self.h_show_beginning, curses.KEY_END: self.h_show_end, ord('g'): self.h_show_beginning, ord('G'): self.h_show_end, curses.ascii.TAB: self.h_exit, curses.KEY_BTAB: self.h_exit_up, '^P': self.h_exit_up, '^N': self.h_exit_down, #curses.ascii.NL: self.h_exit, #curses.ascii.SP: self.h_exit, #ord('x'): self.h_exit, ord('q'): self.h_exit, curses.ascii.ESC: self.h_exit, curses.KEY_MOUSE: self.h_exit_mouse, } self.complex_handlers = [ ]
Example #7
Source File: wggrid.py From EDCOP with Apache License 2.0 | 5 votes |
def set_up_handlers(self): super(SimpleGrid, self).set_up_handlers() self.handlers = { curses.KEY_UP: self.h_move_line_up, curses.KEY_LEFT: self.h_move_cell_left, curses.KEY_DOWN: self.h_move_line_down, curses.KEY_RIGHT: self.h_move_cell_right, "k": self.h_move_line_up, "h": self.h_move_cell_left, "j": self.h_move_line_down, "l": self.h_move_cell_right, curses.KEY_NPAGE: self.h_move_page_down, curses.KEY_PPAGE: self.h_move_page_up, curses.KEY_HOME: self.h_show_beginning, curses.KEY_END: self.h_show_end, ord('g'): self.h_show_beginning, ord('G'): self.h_show_end, curses.ascii.TAB: self.h_exit, curses.KEY_BTAB: self.h_exit_up, '^P': self.h_exit_up, '^N': self.h_exit_down, #curses.ascii.NL: self.h_exit, #curses.ascii.SP: self.h_exit, #ord('x'): self.h_exit, ord('q'): self.h_exit, curses.ascii.ESC: self.h_exit, curses.KEY_MOUSE: self.h_exit_mouse, } self.complex_handlers = [ ]
Example #8
Source File: wggrid.py From TelegramTUI with MIT License | 5 votes |
def set_up_handlers(self): super(SimpleGrid, self).set_up_handlers() self.handlers = { curses.KEY_UP: self.h_move_line_up, curses.KEY_LEFT: self.h_move_cell_left, curses.KEY_DOWN: self.h_move_line_down, curses.KEY_RIGHT: self.h_move_cell_right, "k": self.h_move_line_up, "h": self.h_move_cell_left, "j": self.h_move_line_down, "l": self.h_move_cell_right, curses.KEY_NPAGE: self.h_move_page_down, curses.KEY_PPAGE: self.h_move_page_up, curses.KEY_HOME: self.h_show_beginning, curses.KEY_END: self.h_show_end, ord('g'): self.h_show_beginning, ord('G'): self.h_show_end, curses.ascii.TAB: self.h_exit, curses.KEY_BTAB: self.h_exit_up, '^P': self.h_exit_up, '^N': self.h_exit_down, #curses.ascii.NL: self.h_exit, #curses.ascii.SP: self.h_exit, #ord('x'): self.h_exit, ord('q'): self.h_exit, curses.ascii.ESC: self.h_exit, curses.KEY_MOUSE: self.h_exit_mouse, } self.complex_handlers = [ ]
Example #9
Source File: menu_screen.py From botany with ISC License | 5 votes |
def get_user_string(self, xpos=3, ypos=15, filterfunc=str.isalnum, completer=None): # filter allowed characters using filterfunc, alphanumeric by default user_string = "" user_input = 0 if completer: completer = completer(self) while user_input != 10: user_input = self.screen.getch() if user_input == -1: # Input comes from pipe/file and is closed raise IOError self.screen_lock.acquire() # osx and unix backspace chars... if user_input == 127 or user_input == 263: if len(user_string) > 0: user_string = user_string[:-1] if completer: completer.update_input(user_string) self.screen.addstr(ypos, xpos, " " * (self.maxx-xpos-1)) elif user_input in [ord('\t'), curses.KEY_BTAB] and completer: direction = 1 if user_input == ord('\t') else -1 user_string = completer.complete(direction) self.screen.addstr(ypos, xpos, " " * (self.maxx-xpos-1)) elif user_input < 256 and user_input != 10: if filterfunc(chr(user_input)) or chr(user_input) == '_': user_string += chr(user_input) if completer: completer.update_input(user_string) self.screen.addstr(ypos, xpos, str(user_string)) self.screen.refresh() self.screen_lock.release() return user_string