From e5051c516f4b6edb34a55ba08e009cea1d35d449 Mon Sep 17 00:00:00 2001 From: sowens99 Date: Thu, 23 Sep 2021 01:17:12 -0400 Subject: [PATCH] Check for certain hotkeys in game list There are certain hotkeys that we absolutely want to be able to use without being in-game. Presently, no hotkeys are recognized unless we are in-game. I've identified and moved the following hotkeys to be checked before the HotkeyScheduler checks to see if the Core is running: - Open - Exit - Start Recording - Refresh Game List Note that Play Recording should also be implemented here, however it looks like there is no signal for a PlayRecording() function, so this will have to be handled in a later PR once that signal is created and implemented. --- Source/Core/DolphinQt/HotkeyScheduler.cpp | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Source/Core/DolphinQt/HotkeyScheduler.cpp b/Source/Core/DolphinQt/HotkeyScheduler.cpp index 33eab853e4..e6c5fce20e 100644 --- a/Source/Core/DolphinQt/HotkeyScheduler.cpp +++ b/Source/Core/DolphinQt/HotkeyScheduler.cpp @@ -169,12 +169,25 @@ void HotkeyScheduler::Run() HotkeyManagerEmu::GetStatus(true); - if (!Core::IsRunningAndStarted()) - continue; - + // Open if (IsHotkey(HK_OPEN)) emit Open(); + // Refresh Game List + if (IsHotkey(HK_REFRESH_LIST)) + emit RefreshGameListHotkey(); + + // Recording + if (IsHotkey(HK_START_RECORDING)) + emit StartRecording(); + + // Exit + if (IsHotkey(HK_EXIT)) + emit ExitHotkey(); + + if (!Core::IsRunningAndStarted()) + continue; + // Disc if (IsHotkey(HK_EJECT_DISC)) @@ -192,10 +205,6 @@ void HotkeyScheduler::Run() Common::SleepCurrentThread(100); } - // Refresh Game List - if (IsHotkey(HK_REFRESH_LIST)) - emit RefreshGameListHotkey(); - // Pause and Unpause if (IsHotkey(HK_PLAY_PAUSE)) emit TogglePauseHotkey(); @@ -215,10 +224,6 @@ void HotkeyScheduler::Run() if (IsHotkey(HK_SCREENSHOT)) emit ScreenShotHotkey(); - // Exit - if (IsHotkey(HK_EXIT)) - emit ExitHotkey(); - // Unlock Cursor if (IsHotkey(HK_UNLOCK_CURSOR)) emit UnlockCursor(); @@ -232,10 +237,6 @@ void HotkeyScheduler::Run() if (IsHotkey(HK_REQUEST_GOLF_CONTROL)) emit RequestGolfControl(); - // Recording - if (IsHotkey(HK_START_RECORDING)) - emit StartRecording(); - if (IsHotkey(HK_EXPORT_RECORDING)) emit ExportRecording();