mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
work around shift triggering buttons on win32
This commit is contained in:
parent
dc3ef60c75
commit
93118b2710
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue