Index: trunk/src/lib/event/event_handler.cc
===================================================================
--- trunk/src/lib/event/event_handler.cc	(revision 6769)
+++ trunk/src/lib/event/event_handler.cc	(revision 6771)
@@ -156,16 +156,16 @@
   PRINTF(4)("Subscribing event type: %i\n", eventType);
   if( state == ES_ALL )
-    {
-      for(unsigned int i = 0; i < ES_NUMBER; i++)
-        if( likely(this->listeners[i][eventType] == NULL))
-          this->listeners[i][eventType] = el;
-        else
-          PRINTF(2)("%s of class %s tried to subscribe to event %i @ state %i but this event has already been subscribed\n", el->getName(), el->getClassName(), eventType, state);
-    }
+  {
+    for(unsigned int i = 0; i < ES_NUMBER; i++)
+      if( likely(this->listeners[i][eventType] == NULL))
+        this->listeners[i][eventType] = el;
+      else
+        PRINTF(2)("%s of class %s tried to subscribe to event %i @ state %i but this event has already been subscribed\n", el->getName(), el->getClassName(), eventType, state);
+  }
   else
     if( likely(this->listeners[state][eventType] == NULL))
-      {
-        this->listeners[state][eventType] = el;
-      }
+    {
+      this->listeners[state][eventType] = el;
+    }
     else
       PRINTF(2)("% of class %s tried to subscribe to event %i @ state %i but this event has already been subscribed\n", el->getName(), el->getClassName(), eventType, state);
@@ -203,22 +203,22 @@
     return;
   if( state == ES_ALL)
-    {
-      for(unsigned int i = 0; i < ES_NUMBER; i++)
-        {
-          for(unsigned int j = 0; j < EV_NUMBER; j++)
-            {
-              if( this->listeners[i][j] == el )
-                this->listeners[i][j] = NULL;
-            }
-        }
-    }
-  else
-    {
-      for(int j = 0; j < EV_NUMBER; j++)
-        {
-          if( this->listeners[state][j] == el )
-            this->listeners[state][j] = NULL;
-        }
-    }
+  {
+    for(unsigned int i = 0; i < ES_NUMBER; i++)
+    {
+      for(unsigned int j = 0; j < EV_NUMBER; j++)
+      {
+        if( this->listeners[i][j] == el )
+          this->listeners[i][j] = NULL;
+      }
+    }
+  }
+  else
+  {
+    for(int j = 0; j < EV_NUMBER; j++)
+    {
+      if( this->listeners[state][j] == el )
+        this->listeners[state][j] = NULL;
+    }
+  }
 }
 
@@ -231,20 +231,20 @@
 {
   if( state == ES_ALL)
-    {
-      for(int i = 0; i < ES_NUMBER; ++i)
-        {
-          for(int j = 0; j < EV_NUMBER; ++j)
-            {
-              this->listeners[i][j] = NULL;
-            }
-        }
-    }
-  else
+  {
+    for(int i = 0; i < ES_NUMBER; ++i)
     {
       for(int j = 0; j < EV_NUMBER; ++j)
-        {
-          this->listeners[state][j] = NULL;
-        }
-    }
+      {
+        this->listeners[i][j] = NULL;
+      }
+    }
+  }
+  else
+  {
+    for(int j = 0; j < EV_NUMBER; ++j)
+    {
+      this->listeners[state][j] = NULL;
+    }
+  }
 }
 
@@ -262,5 +262,5 @@
     SDL_WM_GrabInput(SDL_GRAB_OFF);
   else
-    ;//    SDL_WM_GrabInput(SDL_GRAB_ON);
+    SDL_WM_GrabInput(SDL_GRAB_ON);
 }
 
@@ -276,84 +276,84 @@
   EventListener* listener = NULL;
   while( SDL_PollEvent (&event))
-    {
-      switch( event.type)
-        {
-        case SDL_KEYDOWN:
-          ev.bPressed = true;
-          ev.type = event.key.keysym.sym;
-          if (unlikely(this->bUNICODE))
-              ev.x = event.key.keysym.unicode;
-          break;
-        case SDL_KEYUP:
-          ev.bPressed = false;
-          ev.type = event.key.keysym.sym;
-          if (unlikely(this->bUNICODE))
-            ev.x = event.key.keysym.unicode;
-          break;
-        case SDL_MOUSEMOTION:
-          ev.bPressed = false;
-          ev.type = EV_MOUSE_MOTION;
-          ev.x = event.motion.x;
-          ev.y = event.motion.y;
-          ev.xRel = event.motion.xrel;
-          ev.yRel = event.motion.yrel;
-          break;
-        case SDL_MOUSEBUTTONUP:
-          ev.bPressed = false;
-          ev.type = event.button.button + SDLK_LAST;
-          break;
-        case SDL_MOUSEBUTTONDOWN:
-          ev.bPressed = true;
-          ev.type = event.button.button + SDLK_LAST;
-          break;
-        case SDL_JOYAXISMOTION:
-          ev.bPressed = false;
-          ev.type = EV_JOY_AXIS_MOTION;
-          break;
-        case SDL_JOYBALLMOTION:
-          ev.bPressed = false;
-          ev.type = EV_JOY_BALL_MOTION;
-          break;
-        case SDL_JOYHATMOTION:
-          ev.bPressed = false;
-          ev.type = EV_JOY_HAT_MOTION;
-          break;
-        case SDL_JOYBUTTONDOWN:
-          ev.bPressed = true;
-          ev.type = EV_JOY_BUTTON;
-          break;
-        case SDL_JOYBUTTONUP:
-          ev.bPressed = true;
-          ev.type = EV_JOY_BUTTON;
-          break;
-        case SDL_VIDEORESIZE:
-          ev.resize = event.resize;
-          ev.type = EV_VIDEO_RESIZE;
-          break;
-        case SDL_QUIT:
-          ev.type = EV_MAIN_QUIT;
-          break;
-        default:
-          ev.type = EV_UNKNOWN;
-          break;
-        }
-
-      /* small debug routine: shows all events dispatched by the event handler */
-      PRINT(4)("\n==========================| EventHandler::process () |===\n");
-      PRINT(4)("=  Got Event nr %i, for state %i", ev.type, this->state);
-
-      listener = this->listeners[this->state][ev.type];
-      if( listener != NULL)
-        {
-          PRINT(4)("=  Event dispatcher msg: This event has been consumed\n");
-          PRINT(4)("=======================================================\n");
-          listener->process(ev);
-        }
-      else
-        {
-          PRINT(4)("=  Event dispatcher msg: This event has NOT been consumed\n");
-          PRINT(4)("=======================================================\n");
-        }
-    }
+  {
+    switch( event.type)
+    {
+      case SDL_KEYDOWN:
+        ev.bPressed = true;
+        ev.type = event.key.keysym.sym;
+        if (unlikely(this->bUNICODE))
+          ev.x = event.key.keysym.unicode;
+        break;
+      case SDL_KEYUP:
+        ev.bPressed = false;
+        ev.type = event.key.keysym.sym;
+        if (unlikely(this->bUNICODE))
+          ev.x = event.key.keysym.unicode;
+        break;
+      case SDL_MOUSEMOTION:
+        ev.bPressed = false;
+        ev.type = EV_MOUSE_MOTION;
+        ev.x = event.motion.x;
+        ev.y = event.motion.y;
+        ev.xRel = event.motion.xrel;
+        ev.yRel = event.motion.yrel;
+        break;
+      case SDL_MOUSEBUTTONUP:
+        ev.bPressed = false;
+        ev.type = event.button.button + SDLK_LAST;
+        break;
+      case SDL_MOUSEBUTTONDOWN:
+        ev.bPressed = true;
+        ev.type = event.button.button + SDLK_LAST;
+        break;
+      case SDL_JOYAXISMOTION:
+        ev.bPressed = false;
+        ev.type = EV_JOY_AXIS_MOTION;
+        break;
+      case SDL_JOYBALLMOTION:
+        ev.bPressed = false;
+        ev.type = EV_JOY_BALL_MOTION;
+        break;
+      case SDL_JOYHATMOTION:
+        ev.bPressed = false;
+        ev.type = EV_JOY_HAT_MOTION;
+        break;
+      case SDL_JOYBUTTONDOWN:
+        ev.bPressed = true;
+        ev.type = EV_JOY_BUTTON;
+        break;
+      case SDL_JOYBUTTONUP:
+        ev.bPressed = true;
+        ev.type = EV_JOY_BUTTON;
+        break;
+      case SDL_VIDEORESIZE:
+        ev.resize = event.resize;
+        ev.type = EV_VIDEO_RESIZE;
+        break;
+      case SDL_QUIT:
+        ev.type = EV_MAIN_QUIT;
+        break;
+      default:
+        ev.type = EV_UNKNOWN;
+        break;
+    }
+
+    /* small debug routine: shows all events dispatched by the event handler */
+    PRINT(4)("\n==========================| EventHandler::process () |===\n");
+    PRINT(4)("=  Got Event nr %i, for state %i", ev.type, this->state);
+
+    listener = this->listeners[this->state][ev.type];
+    if( listener != NULL)
+    {
+      PRINT(4)("=  Event dispatcher msg: This event has been consumed\n");
+      PRINT(4)("=======================================================\n");
+      listener->process(ev);
+    }
+    else
+    {
+      PRINT(4)("=  Event dispatcher msg: This event has NOT been consumed\n");
+      PRINT(4)("=======================================================\n");
+    }
+  }
 }
 
