From 5ee161985d711c1cbe18b51b6db0076e34ddf613 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Wed, 21 May 2008 20:26:28 +0000 Subject: [PATCH] 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 --- src/mainloop.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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; } } -- 2.11.0