This commit is contained in:
恍兮惚兮 2024-08-14 12:04:13 +08:00
parent 308982b3f0
commit 0c90c6ca7d

View File

@ -104,11 +104,11 @@ class ctrlenter(QPlainTextEdit):
enterpressed = pyqtSignal()
def keyPressEvent(self, e):
if e.key() == Qt.Key_Return or e.key() == Qt.Key_Enter:
if e.key() == Qt.Key.Key_Return or e.key() == Qt.Key.Key_Enter:
if (
e.modifiers() == Qt.ControlModifier
or e.modifiers() == Qt.ShiftModifier
or e.modifiers() == Qt.AltModifier
e.modifiers() == Qt.KeyboardModifier.ControlModifier
or e.modifiers() == Qt.KeyboardModifier.ShiftModifier
or e.modifiers() == Qt.KeyboardModifier.AltModifier
):
self.insertPlainText("\n")
else: