pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r2871 - in branches/pingus_sdl: . src


From: jsalmon3
Subject: [Pingus-CVS] r2871 - in branches/pingus_sdl: . src
Date: Sun, 12 Aug 2007 22:15:40 +0200

Author: jsalmon3
Date: 2007-08-12 22:15:32 +0200 (Sun, 12 Aug 2007)
New Revision: 2871

Modified:
   branches/pingus_sdl/TODO
   branches/pingus_sdl/src/global_event.cpp
Log:
Added alt-enter to toggle full screen and ctrl-g to grab input



Modified: branches/pingus_sdl/TODO
===================================================================
--- branches/pingus_sdl/TODO    2007-08-12 20:11:41 UTC (rev 2870)
+++ branches/pingus_sdl/TODO    2007-08-12 20:15:32 UTC (rev 2871)
@@ -42,10 +42,6 @@
 
 - exit wrong at data/levels/tutorial/snow12-grumbel.scm (colmap removal buggy?)
 
-- add [Ctrl]+g to grab the mouse (according to Darklock that is common for SDL 
apps)
-
-- add Alt-Enter for fullscreen toggling
-
 - Font::draw() origin only works properly for left, right and center break 
with multiline text
 
 - nuke button is unclean, other buttons not so great either -> repaint

Modified: branches/pingus_sdl/src/global_event.cpp
===================================================================
--- branches/pingus_sdl/src/global_event.cpp    2007-08-12 20:11:41 UTC (rev 
2870)
+++ branches/pingus_sdl/src/global_event.cpp    2007-08-12 20:15:32 UTC (rev 
2871)
@@ -48,6 +48,10 @@
       console << "Toggling fps counter display" << std::endl;
       break;
 
+    case SDLK_RETURN:
+      if (!keystate[SDLK_LALT] && !keystate[SDLK_RALT])
+        break;
+      // FALL THROUGH
     case SDLK_F11:
       fullscreen_enabled = !fullscreen_enabled;
       // re-initialize the screen
@@ -79,6 +83,22 @@
         }
       break;
 
+    case SDLK_g:
+      if (keystate[SDLK_LCTRL] || keystate[SDLK_RCTRL])
+        {
+          if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON)
+            {
+              SDL_WM_GrabInput(SDL_GRAB_OFF);
+              console << "Grab input off" << std::endl;
+            }
+          else
+            {
+              SDL_WM_GrabInput(SDL_GRAB_ON);
+              console << "Grab input on" << std::endl;
+            }
+        }
+      break;
+
     default:
       // console << "GlobalEvent: Unknown key pressed: " << key.id;
       break;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]