From 85c236a4174e88637285ee80ddea89deb8ac8f9a Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Sun, 11 Jul 2021 22:40:43 -0300 Subject: [PATCH] Created shortcut to switch between card types on clayout.py editor window (F3 and F4) because it should be simple to use them single hand and together with Ctrl+1, 2 and 3 combos. --- qt/aqt/clayout.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/qt/aqt/clayout.py b/qt/aqt/clayout.py index b00e1fe38..4c69299e1 100644 --- a/qt/aqt/clayout.py +++ b/qt/aqt/clayout.py @@ -185,6 +185,24 @@ class CardLayout(QDialog): self, activated=self.tform.style_button.click, ) + QShortcut( # type: ignore + QKeySequence("F3"), + self, + activated=lambda: ( + self.update_current_ordinal_and_redraw(self.ord - 1) + if self.ord - 1 > -1 + else None + ), + ) + QShortcut( # type: ignore + QKeySequence("F4"), + self, + activated=lambda: ( + self.update_current_ordinal_and_redraw(self.ord + 1) + if self.ord + 1 < len(self.templates) + else None + ), + ) for i in range(min(len(self.cloze_numbers), 9)): QShortcut( # type: ignore QKeySequence(f"Alt+{i+1}"),