From c26d9a64f9e0c47651d32dc162e6d080b64763c4 Mon Sep 17 00:00:00 2001 From: pax Date: Sun, 5 Apr 2026 03:06:47 -0500 Subject: [PATCH] Space to pause/play video when hovering over preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses keyPressEvent on main window — only fires when no text input has focus (search bar consumes Space itself). Checks underMouse() so it only works when hovering the preview. --- booru_viewer/gui/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/booru_viewer/gui/app.py b/booru_viewer/gui/app.py index 660a0a0..516ebaa 100644 --- a/booru_viewer/gui/app.py +++ b/booru_viewer/gui/app.py @@ -1615,6 +1615,10 @@ class BooruApp(QMainWindow): if 0 <= idx < len(self._posts): self._open_in_default(self._posts[idx]) return + elif key == Qt.Key.Key_Space: + if self._preview._stack.currentIndex() == 1 and self._preview.underMouse(): + self._preview._video_player._toggle_play() + return super().keyPressEvent(event) # -- Bookmarks --