mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05: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
|
import sys
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
from aqt.utils import fontForPlatform, openLink
|
from aqt.utils import fontForPlatform, openLink
|
||||||
from anki.utils import isMac
|
from anki.utils import isMac, isWin
|
||||||
import anki.js
|
import anki.js
|
||||||
QtConfig = pyqtconfig.Configuration()
|
QtConfig = pyqtconfig.Configuration()
|
||||||
|
|
||||||
|
|
@ -57,6 +57,10 @@ class AnkiWebView(QWebView):
|
||||||
if evt.matches(QKeySequence.Copy):
|
if evt.matches(QKeySequence.Copy):
|
||||||
self.triggerPageAction(QWebPage.Copy)
|
self.triggerPageAction(QWebPage.Copy)
|
||||||
evt.accept()
|
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)
|
QWebView.keyPressEvent(self, evt)
|
||||||
def keyReleaseEvent(self, evt):
|
def keyReleaseEvent(self, evt):
|
||||||
if self._keyHandler:
|
if self._keyHandler:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue