From 479150a619bbfdfa8d7527e0fee28daecd22724c Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 4 Jun 2019 18:33:23 -0400 Subject: show the main menu when releasing alt instead of pressing, less annoying to take screenshots with alt+printscreen without having the menu pop up --- src/mainwindow.cpp | 4 ++-- src/mainwindow.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 60a86b95..bf357c20 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -6880,7 +6880,7 @@ void MainWindow::dropEvent(QDropEvent *event) event->accept(); } -void MainWindow::keyPressEvent(QKeyEvent *event) +void MainWindow::keyReleaseEvent(QKeyEvent *event) { // if the menubar is hidden, pressing Alt will make it visible if (event->key() == Qt::Key_Alt) { @@ -6890,7 +6890,7 @@ void MainWindow::keyPressEvent(QKeyEvent *event) } } - QMainWindow::keyPressEvent(event); + QMainWindow::keyReleaseEvent(event); } void MainWindow::on_clickBlankButton_clicked() diff --git a/src/mainwindow.h b/src/mainwindow.h index 679065bd..35ac75a9 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -195,7 +195,7 @@ protected: virtual void resizeEvent(QResizeEvent *event); virtual void dragEnterEvent(QDragEnterEvent *event); virtual void dropEvent(QDropEvent *event); - void keyPressEvent(QKeyEvent *event) override; + void keyReleaseEvent(QKeyEvent *event) override; private slots: void on_actionChange_Game_triggered(); -- cgit v1.3.1