mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-06-05 06:04:58 -06:00
UI: Implement hotkey for "Exit application" (#1756)
This commit is contained in:
parent
d86dc5e5f5
commit
07371327f5
@ -161,6 +161,7 @@ HotkeySettings::HotkeySettings(wxWindow* parent)
|
|||||||
#ifdef CEMU_DEBUG_ASSERT
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
CreateHotkeyRow(_tr("End emulation"), s_cfgHotkeys.endEmulation);
|
CreateHotkeyRow(_tr("End emulation"), s_cfgHotkeys.endEmulation);
|
||||||
#endif
|
#endif
|
||||||
|
CreateHotkeyRow(_tr("Exit application"), s_cfgHotkeys.exitApplication);
|
||||||
|
|
||||||
m_controllerTimer = new wxTimer(this);
|
m_controllerTimer = new wxTimer(this);
|
||||||
Bind(wxEVT_TIMER, &HotkeySettings::OnControllerTimer, this);
|
Bind(wxEVT_TIMER, &HotkeySettings::OnControllerTimer, this);
|
||||||
@ -196,6 +197,9 @@ void HotkeySettings::Init(MainWindow* mainWindowFrame)
|
|||||||
{&s_cfgHotkeys.toggleFastForward, [](void) {
|
{&s_cfgHotkeys.toggleFastForward, [](void) {
|
||||||
ActiveSettings::SetTimerShiftFactor((ActiveSettings::GetTimerShiftFactor() < 3) ? 3 : 1);
|
ActiveSettings::SetTimerShiftFactor((ActiveSettings::GetTimerShiftFactor() < 3) ? 3 : 1);
|
||||||
}},
|
}},
|
||||||
|
{&s_cfgHotkeys.exitApplication, [](void) {
|
||||||
|
s_mainWindow->Close(true);
|
||||||
|
}},
|
||||||
#ifdef CEMU_DEBUG_ASSERT
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
{&s_cfgHotkeys.endEmulation, [](void) {
|
{&s_cfgHotkeys.endEmulation, [](void) {
|
||||||
wxTheApp->CallAfter([]() {
|
wxTheApp->CallAfter([]() {
|
||||||
|
|||||||
@ -115,6 +115,7 @@ void wxCemuConfig::Load(XMLConfigParser& parser)
|
|||||||
hotkeys.toggleFullscreenAlt = xml_hotkeys.get("ToggleFullscreenAlt", sHotkeyCfg{uKeyboardHotkey{WXK_CONTROL_M, true}}); // ALT+ENTER
|
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.takeScreenshot = xml_hotkeys.get("TakeScreenshot", sHotkeyCfg{uKeyboardHotkey{WXK_F12}});
|
||||||
hotkeys.toggleFastForward = xml_hotkeys.get("ToggleFastForward", sHotkeyCfg{});
|
hotkeys.toggleFastForward = xml_hotkeys.get("ToggleFastForward", sHotkeyCfg{});
|
||||||
|
hotkeys.exitApplication = xml_hotkeys.get("ExitApplication", sHotkeyCfg{});
|
||||||
#ifdef CEMU_DEBUG_ASSERT
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
hotkeys.endEmulation = xml_hotkeys.get("EndEmulation", sHotkeyCfg{uKeyboardHotkey{WXK_F5}});
|
hotkeys.endEmulation = xml_hotkeys.get("EndEmulation", sHotkeyCfg{uKeyboardHotkey{WXK_F5}});
|
||||||
#endif
|
#endif
|
||||||
@ -185,4 +186,5 @@ void wxCemuConfig::Save(XMLConfigParser& config)
|
|||||||
xml_hotkeys.set("ToggleFullscreenAlt", hotkeys.toggleFullscreenAlt);
|
xml_hotkeys.set("ToggleFullscreenAlt", hotkeys.toggleFullscreenAlt);
|
||||||
xml_hotkeys.set("TakeScreenshot", hotkeys.takeScreenshot);
|
xml_hotkeys.set("TakeScreenshot", hotkeys.takeScreenshot);
|
||||||
xml_hotkeys.set("ToggleFastForward", hotkeys.toggleFastForward);
|
xml_hotkeys.set("ToggleFastForward", hotkeys.toggleFastForward);
|
||||||
|
xml_hotkeys.set("ExitApplication", hotkeys.exitApplication);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,6 +127,7 @@ struct wxCemuConfig
|
|||||||
sHotkeyCfg exitFullscreen;
|
sHotkeyCfg exitFullscreen;
|
||||||
sHotkeyCfg takeScreenshot;
|
sHotkeyCfg takeScreenshot;
|
||||||
sHotkeyCfg toggleFastForward;
|
sHotkeyCfg toggleFastForward;
|
||||||
|
sHotkeyCfg exitApplication;
|
||||||
#ifdef CEMU_DEBUG_ASSERT
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
sHotkeyCfg endEmulation;
|
sHotkeyCfg endEmulation;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user