From: Ingo Ruhnke Date: Wed, 21 May 2008 20:26:28 +0000 (+0000) Subject: Added ugly default key for console (Ctrl-c then F1) that works even if console is... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5ee161985d711c1cbe18b51b6db0076e34ddf613;p=supertux.git Added ugly default key for console (Ctrl-c then F1) that works even if console is disabled. I have been stuck to many times with a game session without console that I wanted to debug SVN-Revision: 5501 --- diff --git a/src/mainloop.cpp b/src/mainloop.cpp index 1f341508e..ec11131d2 100644 --- a/src/mainloop.cpp +++ b/src/mainloop.cpp @@ -180,6 +180,7 @@ void MainLoop::process_events() { main_controller->update(); + Uint8* keystate = SDL_GetKeyState(NULL); SDL_Event event; while(SDL_PollEvent(&event)) { @@ -209,6 +210,14 @@ MainLoop::process_events() { take_screenshot(); } + else if (event.key.keysym.sym == SDLK_F1 && + (keystate[SDLK_LCTRL] || keystate[SDLK_RCTRL]) && + keystate[SDLK_c]) + { + Console::instance->toggle(); + config->console_enabled = true; + config->save(); + } break; } }