mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-07-10 01:24:41 -06:00
Implement hotkey for "Exit application"
This commit is contained in:
parent
13c6d497a0
commit
0556d5536d
@ -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());
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user