mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
On fucking wayland Qt sends us key events with type keypress that are not instances of the QKeyEvent class. Sigh.
This commit is contained in:
parent
4a3994fefd
commit
ca223c7f0c
@ -20,6 +20,7 @@ from qt.core import (
|
||||
QIcon,
|
||||
QItemSelectionModel,
|
||||
QKeyCombination,
|
||||
QKeyEvent,
|
||||
QKeySequence,
|
||||
QLabel,
|
||||
QMenu,
|
||||
@ -519,7 +520,7 @@ class Editor(QFrame): # {{{
|
||||
if t == QEvent.Type.ShortcutOverride:
|
||||
event.accept()
|
||||
return True
|
||||
if t == QEvent.Type.KeyPress:
|
||||
if t == QEvent.Type.KeyPress and isinstance(event, QKeyEvent):
|
||||
self.key_press_event(event, 1 if obj is self.button1 else 2)
|
||||
return True
|
||||
return QFrame.eventFilter(self, obj, event)
|
||||
|
Loading…
x
Reference in New Issue
Block a user