From 65f67284542a5907214f18dce3f1e24106820b63 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Fri, 10 Dec 2021 08:52:08 +0100 Subject: [PATCH] Fix Alt-Gr and add shortcut to create copy again (#1544) * Set QT_QPA_PLATFORM for Win on recent Qt versions Erroneously dropped for Qt 5.15.1+. * Enable original shortcut to create copy * minor tweaks to comment to make it clearer (dae) --- qt/aqt/__init__.py | 10 ++++------ qt/aqt/forms/browser.ui | 3 +++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index eabdb9823..e2b1926d0 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -523,12 +523,10 @@ def _run(argv: Optional[list[str]] = None, exec: bool = True) -> Optional[AnkiAp if os.environ.get("ANKI_SOFTWAREOPENGL"): QCoreApplication.setAttribute(Qt.ApplicationAttribute.AA_UseSoftwareOpenGL) - if ( - is_win - and qtmajor == 5 - and (qtminor == 14 or (qtminor == 15 and qtpoint == 0)) - and "QT_QPA_PLATFORM" not in os.environ - ): + # fix an issue on Windows, where Ctrl+Alt shortcuts are triggered by AltGr, + # preventing users from typing things like "@" through AltGr+Q on a German + # keyboard. + if is_win and "QT_QPA_PLATFORM" not in os.environ: os.environ["QT_QPA_PLATFORM"] = "windows:altgr" # create the app diff --git a/qt/aqt/forms/browser.ui b/qt/aqt/forms/browser.ui index 9a156528a..18e1370a2 100644 --- a/qt/aqt/forms/browser.ui +++ b/qt/aqt/forms/browser.ui @@ -666,6 +666,9 @@ actions_create_copy + + Ctrl+Alt+E +