Added ugly default key for console (Ctrl-c then F1) that works even if console is...
authorIngo Ruhnke <grumbel@gmx.de>
Wed, 21 May 2008 20:26:28 +0000 (20:26 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Wed, 21 May 2008 20:26:28 +0000 (20:26 +0000)
SVN-Revision: 5501

src/mainloop.cpp

index 1f34150..ec11131 100644 (file)
@@ -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;
         }
     }