mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 23:15:38 +00:00
(Android) Fixed an issue where the Alt+F4 keyboard quit shortcut wouldn't work
This commit is contained in:
parent
7b6e16b79d
commit
5ffd06736a
|
@ -453,14 +453,24 @@ bool InputManager::parseEvent(const SDL_Event& event)
|
||||||
|
|
||||||
// There is no need to handle the OS-default quit shortcut (Alt + F4 on Windows and
|
// There is no need to handle the OS-default quit shortcut (Alt + F4 on Windows and
|
||||||
// Linux and Command + Q on macOS) as that's taken care of by the window manager.
|
// Linux and Command + Q on macOS) as that's taken care of by the window manager.
|
||||||
|
// The exception is Android as there are are no default quit shortcuts on this OS.
|
||||||
std::string quitShortcut {Settings::getInstance()->getString("KeyboardQuitShortcut")};
|
std::string quitShortcut {Settings::getInstance()->getString("KeyboardQuitShortcut")};
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
if (quitShortcut != "CmdQ") {
|
if (quitShortcut != "CmdQ") {
|
||||||
|
#elif defined(__ANDROID__)
|
||||||
|
if (true) {
|
||||||
#else
|
#else
|
||||||
if (quitShortcut != "AltF4") {
|
if (quitShortcut != "AltF4") {
|
||||||
#endif
|
#endif
|
||||||
bool quitES {false};
|
bool quitES {false};
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
if (quitShortcut == "AltF4" && event.key.keysym.sym == SDLK_F4 &&
|
||||||
|
(event.key.keysym.mod & KMOD_LALT))
|
||||||
|
quitES = true;
|
||||||
|
else if (quitShortcut == "F4" && event.key.keysym.sym == SDLK_F4 &&
|
||||||
|
#else
|
||||||
if (quitShortcut == "F4" && event.key.keysym.sym == SDLK_F4 &&
|
if (quitShortcut == "F4" && event.key.keysym.sym == SDLK_F4 &&
|
||||||
|
#endif
|
||||||
!(event.key.keysym.mod & KMOD_LALT))
|
!(event.key.keysym.mod & KMOD_LALT))
|
||||||
quitES = true;
|
quitES = true;
|
||||||
else if (quitShortcut == "CtrlQ" && event.key.keysym.sym == SDLK_q &&
|
else if (quitShortcut == "CtrlQ" && event.key.keysym.sym == SDLK_q &&
|
||||||
|
|
Loading…
Reference in a new issue