Handle back button on android
This commit is contained in:
parent
73be29aa61
commit
9f50249ca8
@ -25,7 +25,7 @@ ConsoleView::ConsoleView():
|
||||
|
||||
void ConsoleView::DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt)
|
||||
{
|
||||
if ((ui::Engine::Ref().GraveExitsConsole && scan == SDL_SCANCODE_GRAVE && key != '~') || key == SDLK_ESCAPE)
|
||||
if ((ui::Engine::Ref().GraveExitsConsole && scan == SDL_SCANCODE_GRAVE && key != '~') || key == SDLK_ESCAPE || key == SDLK_AC_BACK)
|
||||
{
|
||||
if (!repeat)
|
||||
doClose = true;
|
||||
|
@ -254,6 +254,7 @@ void ElementSearchActivity::OnKeyPress(int key, int scan, bool repeat, bool shif
|
||||
if(firstResult)
|
||||
gameController->SetActiveTool(0, firstResult);
|
||||
case SDLK_ESCAPE:
|
||||
case SDLK_AC_BACK:
|
||||
exit = true;
|
||||
break;
|
||||
case SDLK_LSHIFT:
|
||||
|
@ -16,6 +16,8 @@ namespace ui
|
||||
constexpr int MAX_WIDTH = 64;
|
||||
class FontEditor: public ui::Window
|
||||
{
|
||||
void HandleExit();
|
||||
|
||||
private:
|
||||
ByteString dataFile;
|
||||
std::map<String::value_type, unsigned char> fontWidths;
|
||||
|
@ -1597,6 +1597,12 @@ void GameView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl,
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case SDLK_AC_BACK:
|
||||
if (ALLOW_QUIT)
|
||||
{
|
||||
ui::Engine::Ref().ConfirmExit();
|
||||
}
|
||||
break;
|
||||
case SDLK_TAB: //Tab
|
||||
c->ChangeBrush();
|
||||
break;
|
||||
|
@ -366,7 +366,7 @@ void Window::DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, b
|
||||
if (!stop)
|
||||
OnKeyPress(key, scan, repeat, shift, ctrl, alt);
|
||||
|
||||
if (key == SDLK_ESCAPE)
|
||||
if (key == SDLK_ESCAPE || key == SDLK_AC_BACK)
|
||||
OnTryExit(Escape);
|
||||
|
||||
if (key == SDLK_KP_ENTER || key == SDLK_RETURN)
|
||||
|
@ -201,7 +201,7 @@ void LocalBrowserView::OnKeyPress(int key, int scan, bool repeat, bool shift, bo
|
||||
{
|
||||
if (repeat)
|
||||
return;
|
||||
if (key == SDLK_ESCAPE)
|
||||
if (key == SDLK_ESCAPE || key == SDLK_AC_BACK)
|
||||
c->Exit();
|
||||
else if (key == SDLK_LCTRL || key == SDLK_RCTRL)
|
||||
c->SetMoveToFront(false);
|
||||
|
@ -643,7 +643,7 @@ void SearchView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctr
|
||||
{
|
||||
if (repeat)
|
||||
return;
|
||||
if (key == SDLK_ESCAPE)
|
||||
if (key == SDLK_ESCAPE || key == SDLK_AC_BACK)
|
||||
c->Exit();
|
||||
else if ((focusedComponent_ != pageTextbox && focusedComponent_ != searchField) && scan == SDL_SCANCODE_A && ctrl)
|
||||
c->SelectAllSaves();
|
||||
|
Reference in New Issue
Block a user