(self, scan, c)
Handle keyboard clipboard commands.
Handle keyboard clipboard commands.
Handle keyboard clipboard commands .
def handle_key(self, scan, c):
        """Handle keyboard clipboard commands."""
        if not self._active:
            return
        if c.upper() == u'C':
            self.copy()
        elif c.upper() == u'V':
            text = self._clipboard_handler.paste()
            self.paste(text)
        elif c.upper() == u'A':
            # select all
            self.select_start = [1, 1]
            self.move(self.height, self.width+1)
        elif scan == scancode.LEFT:
            # move selection head left
            self.move(self.select_stop[0], self.select_stop[1]-1)
        elif scan == scancode.RIGHT:
            # move selection head right
            self.move(self.select_stop[0], self.select_stop[1]+1)
        elif scan == scancode.UP:
            # move selection head up
            self.move(self.select_stop[0]-1, self.select_stop[1])
        elif scan == scancode.DOWN:
            # move selection head down
            self.move(self.select_stop[0]+1, self.select_stop[1])
def handle_key ( self , scan , c ) : if not self . _active : return if c . upper ( ) == u'C' : self . copy ( ) elif c . upper ( ) == u'V' : text = self . _clipboard_handler . paste ( ) self . paste ( text ) elif c . upper ( ) == u'A' : # select all self . select_start = [ 1 , 1 ] self . move ( self . height , self . width + 1 ) elif scan == scancode . LEFT : # move selection head left self . move ( self . select_stop [ 0 ] , self . select_stop [ 1 ] - 1 ) elif scan == scancode . RIGHT : # move selection head right self . move ( self . select_stop [ 0 ] , self . select_stop [ 1 ] + 1 ) elif scan == scancode . UP : # move selection head up self . move ( self . select_stop [ 0 ] - 1 , self . select_stop [ 1 ] ) elif scan == scancode . DOWN : # move selection head down self . move ( self . select_stop [ 0 ] + 1 , self . select_stop [ 1 ] )