From d0add7a609ec818b4bfb93ca586873b41847d3a9 Mon Sep 17 00:00:00 2001 From: harry Date: Tue, 23 Aug 2022 18:36:39 -0400 Subject: [PATCH] For Qt GUI added separate hot keys for soft and hard reset functions. Changed soft reset to be default Ctrl+R and hard reset to Ctrl+Shift+R. --- src/drivers/Qt/ConsoleWindow.cpp | 11 +++++++---- src/drivers/Qt/config.cpp | 7 +++++-- src/drivers/Qt/config.h | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/drivers/Qt/ConsoleWindow.cpp b/src/drivers/Qt/ConsoleWindow.cpp index 23e4bf40..fd5119c4 100644 --- a/src/drivers/Qt/ConsoleWindow.cpp +++ b/src/drivers/Qt/ConsoleWindow.cpp @@ -1282,16 +1282,16 @@ void consoleWin_t::createMainMenu(void) connect( Hotkeys[ HK_POWER ].getShortcut(), SIGNAL(activated()), this, SLOT(powerConsoleCB(void)) ); // Emulation -> Reset - resetAct = new QAction(tr("&Reset"), this); + resetAct = new QAction(tr("Hard &Reset"), this); //resetAct->setShortcut( QKeySequence(tr("Ctrl+R"))); - resetAct->setStatusTip(tr("Reset Console")); + resetAct->setStatusTip(tr("Hard Reset of Console")); resetAct->setIcon( style()->standardIcon( QStyle::SP_DialogResetButton ) ); connect(resetAct, SIGNAL(triggered()), this, SLOT(consoleHardReset(void)) ); emuMenu->addAction(resetAct); - Hotkeys[ HK_RESET ].setAction( resetAct ); - connect( Hotkeys[ HK_RESET ].getShortcut(), SIGNAL(activated()), this, SLOT(consoleHardReset(void)) ); + Hotkeys[ HK_HARD_RESET ].setAction( resetAct ); + connect( Hotkeys[ HK_HARD_RESET ].getShortcut(), SIGNAL(activated()), this, SLOT(consoleHardReset(void)) ); // Emulation -> Soft Reset sresetAct = new QAction(tr("&Soft Reset"), this); @@ -1302,6 +1302,9 @@ void consoleWin_t::createMainMenu(void) emuMenu->addAction(sresetAct); + Hotkeys[ HK_SOFT_RESET ].setAction( sresetAct ); + connect( Hotkeys[ HK_SOFT_RESET ].getShortcut(), SIGNAL(activated()), this, SLOT(consoleSoftReset(void)) ); + // Emulation -> Pause pauseAct = new QAction(tr("&Pause"), this); //pauseAct->setShortcut( QKeySequence(tr("Pause"))); diff --git a/src/drivers/Qt/config.cpp b/src/drivers/Qt/config.cpp index 25442b96..fff49ff4 100644 --- a/src/drivers/Qt/config.cpp +++ b/src/drivers/Qt/config.cpp @@ -187,8 +187,11 @@ int getHotKeyConfig( int i, const char **nameOut, const char **keySeqOut, const case HK_POWER: name = "Power"; keySeq = ""; title = "Power"; group = "Emulation"; break; - case HK_RESET: - name = "Reset"; keySeq = "Ctrl+R"; title = "Reset"; group = "Emulation"; + case HK_SOFT_RESET: + name = "SoftReset"; keySeq = "Ctrl+R"; title = "Soft Reset"; group = "Emulation"; + break; + case HK_HARD_RESET: + name = "HardReset"; keySeq = "Ctrl+Shift+R"; title = "Hard Reset"; group = "Emulation"; break; case HK_PAUSE: name = "Pause"; keySeq = "Pause"; title = "Pause"; group = "Emulation"; diff --git a/src/drivers/Qt/config.h b/src/drivers/Qt/config.h index d719f12d..5b2beb92 100644 --- a/src/drivers/Qt/config.h +++ b/src/drivers/Qt/config.h @@ -14,7 +14,7 @@ enum HOTKEY { HK_OPEN_ROM=0, HK_CLOSE_ROM, // Emulation power, reset, pause, quit - HK_POWER, HK_RESET, HK_PAUSE, HK_QUIT, + HK_POWER, HK_SOFT_RESET, HK_HARD_RESET, HK_PAUSE, HK_QUIT, // Emulation Execution Control HK_FRAME_ADVANCE, HK_DECREASE_SPEED, HK_INCREASE_SPEED, HK_TURBO,