def keyPressEvent(self, event: QKeyEvent): if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return: return else: super().keyPressEvent(event)