From 74d8697ea349750116fa1434f1b00008fdbfe9b6 Mon Sep 17 00:00:00 2001 From: Sean Yeh <109418+seanyeh@users.noreply.github.com> Date: Fri, 3 Apr 2020 22:47:29 -0500 Subject: [PATCH] Qt/GameList: Use KeyPress instead of KeyRelease This fixes a bug where pressing Enter in the "Do you want to stop the current emulation?" confirmation popup also triggers a KeyRelease in GameList, which starts a new game. --- Source/Core/DolphinQt/GameList/GameList.cpp | 4 ++-- Source/Core/DolphinQt/GameList/GameList.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp index edcb38923e..c1765e1f4c 100644 --- a/Source/Core/DolphinQt/GameList/GameList.cpp +++ b/Source/Core/DolphinQt/GameList/GameList.cpp @@ -897,12 +897,12 @@ void GameList::ConsiderViewChange() setCurrentWidget(m_empty); } } -void GameList::keyReleaseEvent(QKeyEvent* event) +void GameList::keyPressEvent(QKeyEvent* event) { if (event->key() == Qt::Key_Return && GetSelectedGame() != nullptr) emit GameSelected(); else - QStackedWidget::keyReleaseEvent(event); + QStackedWidget::keyPressEvent(event); } void GameList::OnColumnVisibilityToggled(const QString& row, bool visible) diff --git a/Source/Core/DolphinQt/GameList/GameList.h b/Source/Core/DolphinQt/GameList/GameList.h index 596c92f57e..5192e89230 100644 --- a/Source/Core/DolphinQt/GameList/GameList.h +++ b/Source/Core/DolphinQt/GameList/GameList.h @@ -94,5 +94,5 @@ private: bool m_prefer_list; protected: - void keyReleaseEvent(QKeyEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; };