diff --git a/qt/aqt/addcards.py b/qt/aqt/addcards.py index 5c97697f7..13b9e9cc5 100644 --- a/qt/aqt/addcards.py +++ b/qt/aqt/addcards.py @@ -109,7 +109,7 @@ class AddCards(QMainWindow): self.addButton = bb.addButton(tr.actions_add(), ar) qconnect(self.addButton.clicked, self.add_current_note) self.addButton.setShortcut(QKeySequence("Ctrl+Return")) - # qt5.14 doesn't handle numpad enter on Windows + # qt5.14+ doesn't handle numpad enter on Windows self.compat_add_shorcut = QShortcut(QKeySequence("Ctrl+Enter"), self) qconnect(self.compat_add_shorcut.activated, self.addButton.click) self.addButton.setToolTip(shortcut(tr.adding_add_shortcut_ctrlandenter())) diff --git a/qt/aqt/editcurrent.py b/qt/aqt/editcurrent.py index 055a3aef5..48140d789 100644 --- a/qt/aqt/editcurrent.py +++ b/qt/aqt/editcurrent.py @@ -28,9 +28,11 @@ class EditCurrent(QMainWindow): self.editor.card = self.mw.reviewer.card self.editor.set_note(self.mw.reviewer.card.note(), focusTo=0) restoreGeom(self, "editcurrent") - self.form.buttonBox.button(QDialogButtonBox.StandardButton.Close).setShortcut( - QKeySequence("Ctrl+Return") - ) + close_button = self.form.buttonBox.button(QDialogButtonBox.StandardButton.Close) + close_button.setShortcut(QKeySequence("Ctrl+Return")) + # qt5.14+ doesn't handle numpad enter on Windows + self.compat_add_shorcut = QShortcut(QKeySequence("Ctrl+Enter"), self) + qconnect(self.compat_add_shorcut.activated, close_button.click) gui_hooks.operation_did_execute.append(self.on_operation_did_execute) self.show()