From ce1b6c9c3c0166853089a247add9c2baa016c5f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 Sep 2013 19:44:57 +0300 Subject: by default assign back button to quit in SDL2 on Android. --- src/gui/sdlinput.cpp | 3 +++ src/input/keyboarddata.h | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index a942d6909..c869cd99b 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -369,6 +369,9 @@ int SDLInput::convertKeyCharacter(const SDL_Event &event) } break; case SDLK_ESCAPE: +#ifdef USE_SDL2 + case SDLK_AC_BACK: +#endif value = Key::ESCAPE; break; case SDLK_DELETE: diff --git a/src/input/keyboarddata.h b/src/input/keyboarddata.h index bd5395007..e9703eac7 100644 --- a/src/input/keyboarddata.h +++ b/src/input/keyboarddata.h @@ -211,7 +211,11 @@ static const KeyData keyData[Input::KEY_TOTAL] = { COND_NOMODAL | COND_NOAWAY | COND_NONPCINPUT}, {"keyQuit", INPUT_KEYBOARD, SDLK_ESCAPE, +#if defined(USE_SDL2) && defined(ANDROID) + INPUT_KEYBOARD, SDLK_AC_BACK, +#else INPUT_UNKNOWN, Input::KEY_NO_VALUE, +#endif Input::GRP_DEFAULT, &ActionManager::quit, Input::KEY_NO_VALUE, 50, @@ -1857,7 +1861,11 @@ static const KeyData keyData[Input::KEY_TOTAL] = { COND_DEFAULT}, {"keyGUICancel", INPUT_KEYBOARD, SDLK_ESCAPE, +#if defined(USE_SDL2) && defined(ANDROID) + INPUT_KEYBOARD, SDLK_AC_BACK, +#else INPUT_UNKNOWN, Input::KEY_NO_VALUE, +#endif Input::GRP_GUICHAN, nullptr, Input::KEY_NO_VALUE, 50, -- cgit v1.2.3-60-g2f50