(self)
Define methods for each key.
Define methods for each key.
Define methods for each key .
def keys_init(self):
        """Define methods for each key.

        """
        self.keys = {
            curses.KEY_BACKSPACE:                self.backspace,
            curses.KEY_DOWN:                     self.down,
            curses.KEY_END:                      self.end,
            curses.KEY_ENTER:                    self.insert_line_or_quit,
            curses.KEY_HOME:                     self.home,
            curses.KEY_DC:                       self.del_char,
            curses.KEY_LEFT:                     self.left,
            curses.KEY_NPAGE:                    self.page_down,
            curses.KEY_PPAGE:                    self.page_up,
            curses.KEY_RIGHT:                    self.right,
            curses.KEY_UP:                       self.up,
            curses.KEY_F1:                       self.help,
            curses.KEY_F2:                       self.quit,
            curses.KEY_F5:                       self.quit_nosave,
            curses.KEY_RESIZE:                   self.resize,
            chr(curses.ascii.ctrl(ord('x'))):    self.quit,
            chr(curses.ascii.ctrl(ord('u'))):    self.del_to_bol,
            chr(curses.ascii.ctrl(ord('k'))):    self.del_to_eol,
            chr(curses.ascii.ctrl(ord('d'))):    self.close,
            chr(curses.ascii.DEL):               self.backspace,
            chr(curses.ascii.NL):                self.insert_line_or_quit,
            chr(curses.ascii.LF):                self.insert_line_or_quit,
            chr(curses.ascii.BS):                self.backspace,
            chr(curses.ascii.ESC):               self.quit_nosave,
            chr(curses.ascii.ETX):               self.close,
            "\n":                                self.insert_line_or_quit,
            -1:                                  self.resize,
            "\t":                                self.tab_completion
        }
def keys_init ( self ) : self . keys = { curses . KEY_BACKSPACE : self . backspace , curses . KEY_DOWN : self . down , curses . KEY_END : self . end , curses . KEY_ENTER : self . insert_line_or_quit , curses . KEY_HOME : self . home , curses . KEY_DC : self . del_char , curses . KEY_LEFT : self . left , curses . KEY_NPAGE : self . page_down , curses . KEY_PPAGE : self . page_up , curses . KEY_RIGHT : self . right , curses . KEY_UP : self . up , curses . KEY_F1 : self . help , curses . KEY_F2 : self . quit , curses . KEY_F5 : self . quit_nosave , curses . KEY_RESIZE : self . resize , chr ( curses . ascii . ctrl ( ord ( 'x' ) ) ) : self . quit , chr ( curses . ascii . ctrl ( ord ( 'u' ) ) ) : self . del_to_bol , chr ( curses . ascii . ctrl ( ord ( 'k' ) ) ) : self . del_to_eol , chr ( curses . ascii . ctrl ( ord ( 'd' ) ) ) : self . close , chr ( curses . ascii . DEL ) : self . backspace , chr ( curses . ascii . NL ) : self . insert_line_or_quit , chr ( curses . ascii . LF ) : self . insert_line_or_quit , chr ( curses . ascii . BS ) : self . backspace , chr ( curses . ascii . ESC ) : self . quit_nosave , chr ( curses . ascii . ETX ) : self . close , "\n" : self . insert_line_or_quit , - 1 : self . resize , "\t" : self . tab_completion }