diff --git a/src/gui/wxgui/input/HotkeySettings.cpp b/src/gui/wxgui/input/HotkeySettings.cpp index 0bf59025..8f721401 100644 --- a/src/gui/wxgui/input/HotkeySettings.cpp +++ b/src/gui/wxgui/input/HotkeySettings.cpp @@ -157,6 +157,7 @@ HotkeySettings::HotkeySettings(wxWindow* parent) CreateHotkeyRow(_tr("Toggle fullscreen"), s_cfgHotkeys.toggleFullscreen); CreateHotkeyRow(_tr("Take screenshot"), s_cfgHotkeys.takeScreenshot); CreateHotkeyRow(_tr("Toggle fast-forward"), s_cfgHotkeys.toggleFastForward); + CreateHotkeyRow(_tr("Exit application"), s_cfgHotkeys.exitApplication); m_controllerTimer = new wxTimer(this); Bind(wxEVT_TIMER, &HotkeySettings::OnControllerTimer, this); @@ -192,6 +193,9 @@ void HotkeySettings::Init(MainWindow* mainWindowFrame) {&s_cfgHotkeys.toggleFastForward, [](void) { ActiveSettings::SetTimerShiftFactor((ActiveSettings::GetTimerShiftFactor() < 3) ? 3 : 1); }}, + {&s_cfgHotkeys.exitApplication, [](void) { + s_mainWindow->Close(true); + }}, }); s_keyboardHotkeyToFuncMap.reserve(s_cfgHotkeyToFuncMap.size()); diff --git a/src/gui/wxgui/wxCemuConfig.cpp b/src/gui/wxgui/wxCemuConfig.cpp index bbd24ab4..327b443a 100644 --- a/src/gui/wxgui/wxCemuConfig.cpp +++ b/src/gui/wxgui/wxCemuConfig.cpp @@ -115,6 +115,7 @@ void wxCemuConfig::Load(XMLConfigParser& parser) hotkeys.toggleFullscreenAlt = xml_hotkeys.get("ToggleFullscreenAlt", sHotkeyCfg{uKeyboardHotkey{WXK_CONTROL_M, true}}); // ALT+ENTER hotkeys.takeScreenshot = xml_hotkeys.get("TakeScreenshot", sHotkeyCfg{uKeyboardHotkey{WXK_F12}}); hotkeys.toggleFastForward = xml_hotkeys.get("ToggleFastForward", sHotkeyCfg{}); + hotkeys.exitApplication = xml_hotkeys.get("ExitApplication", sHotkeyCfg{}); } void wxCemuConfig::Save(XMLConfigParser& config) @@ -182,4 +183,5 @@ void wxCemuConfig::Save(XMLConfigParser& config) xml_hotkeys.set("ToggleFullscreenAlt", hotkeys.toggleFullscreenAlt); xml_hotkeys.set("TakeScreenshot", hotkeys.takeScreenshot); xml_hotkeys.set("ToggleFastForward", hotkeys.toggleFastForward); + xml_hotkeys.set("ExitApplication", hotkeys.exitApplication); } diff --git a/src/gui/wxgui/wxCemuConfig.h b/src/gui/wxgui/wxCemuConfig.h index 9463d4df..81b6c557 100644 --- a/src/gui/wxgui/wxCemuConfig.h +++ b/src/gui/wxgui/wxCemuConfig.h @@ -127,6 +127,7 @@ struct wxCemuConfig sHotkeyCfg exitFullscreen; sHotkeyCfg takeScreenshot; sHotkeyCfg toggleFastForward; + sHotkeyCfg exitApplication; } hotkeys{}; void AddRecentlyLaunchedFile(std::string_view file); @@ -148,4 +149,4 @@ inline XMLWxCemuConfig_t& GetWxGuiConfigHandle() inline wxCemuConfig& GetWxGUIConfig() { return GetWxGuiConfigHandle().Data(); -} \ No newline at end of file +}