From d1d2e0e1bc93cccee4f46174c58bc5a511b63c92 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Tue, 23 Aug 2022 16:32:38 +0600 Subject: [PATCH] qt: Shortcut fixes * Make Pause key pause/resume the emulator * Make screenshot taking and C+A+D shortcuts work on fullscreen --- src/qt/qt_mainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 0ee5a3161..6b7562c28 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1632,6 +1632,12 @@ void MainWindow::keyPressEvent(QKeyEvent* event) if (keyboard_ismsexit()) { plat_mouse_capture(0); } + + if ((video_fullscreen > 0) && (keyboard_recv(0x1D) || keyboard_recv(0x11D))) { + if (keyboard_recv(0x57)) ui->actionTake_screenshot->trigger(); + else if (keyboard_recv(0x58)) pc_send_cad(); + } + event->accept(); } @@ -1646,6 +1652,9 @@ void MainWindow::blitToWidget(int x, int y, int w, int h, int monitor_index) void MainWindow::keyReleaseEvent(QKeyEvent* event) { + if (event->key() == Qt::Key_Pause) { + plat_pause(dopause ^ 1); + } if (!send_keyboard_input) return;