diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 4eb4a80a4..038ad5c4f 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -1187,20 +1187,16 @@ void GuiMenu::openOtherOptions() // Exit button configuration. auto exit_button_config = std::make_shared> (mWindow, getHelpStyle(), "EXIT BUTTON COMBO", false); - std::vector exitButtonCombos; - exitButtonCombos.push_back("F4"); - exitButtonCombos.push_back("Alt + F4"); + std::string selectedExitButtonCombo = Settings::getInstance()->getString("ExitButtonCombo"); + exit_button_config->add("F4", "F4", selectedExitButtonCombo == "F4"); + exit_button_config->add("Alt + F4", "AltF4", selectedExitButtonCombo == "AltF4"); #if defined(_WIN64) || defined(__unix__) - exitButtonCombos.push_back("Alt + Q"); + exit_button_config->add("Alt + Q", "AltQ", selectedExitButtonCombo == "AltQ"); #endif #if defined(__APPLE__) - exitButtonCombos.push_back("\u2318 + Q"); + exit_button_config->add("\u2318 + Q", "CmdQ", selectedExitButtonCombo == "CmdQ"); #endif - for (auto it = exitButtonCombos.cbegin(); it != exitButtonCombos.cend(); it++) { - exit_button_config->add(*it, *it, Settings::getInstance()-> - getString("ExitButtonCombo") == *it); - } - s->addWithLabel("CHOOSE EXIT BUTTON COMBO", exit_button_config); + s->addWithLabel("EXIT BUTTON COMBO", exit_button_config); s->addSaveFunc([exit_button_config, s] { if (exit_button_config->getSelected() != Settings::getInstance()->getString("ExitButtonCombo")) { diff --git a/es-core/src/InputManager.cpp b/es-core/src/InputManager.cpp index 53c28cea8..d2868289f 100644 --- a/es-core/src/InputManager.cpp +++ b/es-core/src/InputManager.cpp @@ -455,11 +455,11 @@ bool InputManager::parseEvent(const SDL_Event& event, Window* window) // handle application exit bool exitState; std::string exitOption = Settings::getInstance()->getString("ExitButtonCombo"); - if (exitOption == "Alt + F4"){ + if (exitOption == "AltF4"){ exitState = event.key.keysym.sym == SDLK_F4 && altDown; - }else if (exitOption == "\u2318 + Q"){ + }else if (exitOption == "CmdQ"){ exitState = event.key.keysym.sym == SDLK_q && lguiDown; - }else if (exitOption == "Alt + Q"){ + }else if (exitOption == "AltQ"){ exitState = event.key.keysym.sym == SDLK_q && altDown; }else{ exitState = event.key.keysym.sym == SDLK_F4;