From 93118b2710a73dd2147fd3c7afa2960aaa47007b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 7 Apr 2012 21:23:51 +0900 Subject: [PATCH] work around shift triggering buttons on win32 --- aqt/webview.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aqt/webview.py b/aqt/webview.py index 47135e24e..aa236bc07 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -5,7 +5,7 @@ import sys from aqt.qt import * from aqt.utils import fontForPlatform, openLink -from anki.utils import isMac +from anki.utils import isMac, isWin import anki.js QtConfig = pyqtconfig.Configuration() @@ -57,6 +57,10 @@ class AnkiWebView(QWebView): if evt.matches(QKeySequence.Copy): self.triggerPageAction(QWebPage.Copy) evt.accept() + # work around a bug with windows qt where shift triggers buttons + if isWin and evt.modifiers() == Qt.ShiftModifier and not evt.text(): + evt.accept() + return QWebView.keyPressEvent(self, evt) def keyReleaseEvent(self, evt): if self._keyHandler: