From 84b49e4423151da63f3fa7d4c9900f2108c15d3b Mon Sep 17 00:00:00 2001 From: pax Date: Sun, 5 Apr 2026 14:27:08 -0500 Subject: [PATCH] =?UTF-8?q?Fix=20Ctrl+C=20=E2=80=94=20use=20QShortcut=20in?= =?UTF-8?q?stead=20of=20keyPressEvent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Grid widget was consuming the key event before it reached the main window. QShortcut properly intercepts regardless of which widget has focus. --- booru_viewer/gui/app.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/booru_viewer/gui/app.py b/booru_viewer/gui/app.py index 72de1c4..9cd54d0 100644 --- a/booru_viewer/gui/app.py +++ b/booru_viewer/gui/app.py @@ -445,6 +445,7 @@ class BooruApp(QMainWindow): # Global shortcuts for preview navigation QShortcut(QKeySequence("Left"), self, lambda: self._navigate_preview(-1)) QShortcut(QKeySequence("Right"), self, lambda: self._navigate_preview(1)) + QShortcut(QKeySequence("Ctrl+C"), self, self._copy_preview_to_clipboard) def _setup_menu(self) -> None: menu = self.menuBar() @@ -1892,9 +1893,6 @@ class BooruApp(QMainWindow): if self._preview._stack.currentIndex() == 1 and self._preview.underMouse(): self._preview._video_player._toggle_play() return - elif key == Qt.Key.Key_C and event.modifiers() == Qt.KeyboardModifier.ControlModifier: - self._copy_preview_to_clipboard() - return super().keyPressEvent(event) def _copy_preview_to_clipboard(self) -> None: