'Pre-process keypress event:
return True if event is accepted, false otherwise'

def preprocess_keyevent(self, event):

    ctrl = (event.modifiers() & Qt.ControlModifier)
    meta = (event.modifiers() & Qt.MetaModifier)
    if ((event.key() == Qt.Key_C) and ((Qt.MetaModifier | Qt.ControlModifier) & event.modifiers())):
        if (meta and (sys.platform == 'darwin')):
            self.interrupt()
        elif ctrl:
            self.copy()
        event.accept()
        return True
    if (self.new_input_line and (len(event.text()) or (event.key() in (Qt.Key_Up, Qt.Key_Down, Qt.Key_Left, Qt.Key_Right)))):
        self.on_new_line()
    return False
