Don't intercept keys from text inputs in slideshow event filter
Space, arrow keys etc. now work normally in search bar and other text fields while slideshow is open.
This commit is contained in:
parent
339c1b3c02
commit
c8d38edf06
@ -66,7 +66,11 @@ class FullscreenPreview(QMainWindow):
|
|||||||
|
|
||||||
def eventFilter(self, obj, event):
|
def eventFilter(self, obj, event):
|
||||||
from PySide6.QtCore import QEvent
|
from PySide6.QtCore import QEvent
|
||||||
|
from PySide6.QtWidgets import QLineEdit, QTextEdit, QSpinBox, QComboBox
|
||||||
if event.type() == QEvent.Type.KeyPress:
|
if event.type() == QEvent.Type.KeyPress:
|
||||||
|
# Don't intercept keys when typing in text inputs
|
||||||
|
if isinstance(obj, (QLineEdit, QTextEdit, QSpinBox, QComboBox)):
|
||||||
|
return super().eventFilter(obj, event)
|
||||||
key = event.key()
|
key = event.key()
|
||||||
if key in (Qt.Key.Key_Escape, Qt.Key.Key_Q):
|
if key in (Qt.Key.Key_Escape, Qt.Key.Key_Q):
|
||||||
self.close()
|
self.close()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user