def keyPressEvent(self, event: QKeySequence) -> None: # Prevent escape from closing window if event.key() != Qt.Key_Escape: super().keyPressEvent(event)