Index: orxonox/trunk/src/lib/event/event_handler.cc
===================================================================
--- orxonox/trunk/src/lib/event/event_handler.cc	(revision 4864)
+++ orxonox/trunk/src/lib/event/event_handler.cc	(revision 4866)
@@ -63,10 +63,7 @@
 EventHandler::~EventHandler ()
 {
-  EventHandler::singletonRef = NULL;
-  delete this->keyMapper;
-
   for(int i = 0; i < ES_NUMBER; ++i)
   {
-    for(int j = 0; j < SDLK_LAST; ++j)
+    for(int j = 0; j < EV_NUMBER; ++j)
     {
       if( this->listeners[i][j] != NULL)
@@ -76,4 +73,6 @@
     }
   }
+  delete this->keyMapper;
+  EventHandler::singletonRef = NULL;
 }
 
@@ -84,8 +83,8 @@
    this has to be called before the use of the event handler
 */
-void EventHandler::init()
+void EventHandler::init(IniParser* iniParser)
 {
   this->keyMapper = new KeyMapper();
-  this->keyMapper->loadKeyBindings();
+  this->keyMapper->loadKeyBindings(iniParser);
 }
 
Index: orxonox/trunk/src/lib/event/event_handler.h
===================================================================
--- orxonox/trunk/src/lib/event/event_handler.h	(revision 4864)
+++ orxonox/trunk/src/lib/event/event_handler.h	(revision 4866)
@@ -15,4 +15,5 @@
 class EventListener;
 template <class T> class tList;
+class IniParser;
 
 //! The one Event Handler from Orxonox
@@ -23,5 +24,5 @@
   /** @returns a Pointer to the only object of this Class */
   inline static EventHandler* getInstance() { if (!singletonRef) singletonRef = new EventHandler();  return singletonRef; };
-  void init();
+  void init(IniParser* iniParser);
 
   void setState(elState state);
Index: orxonox/trunk/src/lib/event/event_listener.cc
===================================================================
--- orxonox/trunk/src/lib/event/event_listener.cc	(revision 4864)
+++ orxonox/trunk/src/lib/event/event_listener.cc	(revision 4866)
@@ -37,4 +37,4 @@
 {
   /* unsubscribes itself from the event listener */
-  EventHandler::getInstance()->unsubscribe(this);
+  EventHandler::getInstance()->unsubscribe(this, ES_ALL);
 }
Index: orxonox/trunk/src/lib/event/key_mapper.cc
===================================================================
--- orxonox/trunk/src/lib/event/key_mapper.cc	(revision 4864)
+++ orxonox/trunk/src/lib/event/key_mapper.cc	(revision 4866)
@@ -115,15 +115,15 @@
 void KeyMapper::loadKeyBindings (const char* fileName)
 {
-  FILE* stream;
-
-  PRINTF(4)("Loading key bindings from %s\n", fileName);
-
-  // create parser
   IniParser parser(fileName);
-  if( parser.getSection (CONFIG_SECTION_PLAYER "1") == -1)
-    {
-      PRINTF(1)("Could not find key bindings " CONFIG_SECTION_PLAYER"1 in %s\n", fileName);
-      return;
-    }
+  this->loadKeyBindings(&parser);
+}
+
+void KeyMapper::loadKeyBindings(IniParser* iniParser)
+{
+  if( iniParser->getSection (CONFIG_SECTION_PLAYER "1") == -1)
+  {
+    PRINTF(1)("Could not find key bindings " CONFIG_SECTION_PLAYER"1\n");
+    return;
+  }
   // allocate empty lookup table
 
@@ -134,58 +134,57 @@
   int* index;
 
-  while( parser.nextVar (namebuf, valuebuf) != -1)
-    {
-      PRINTF(3)("Keys: Parsing %s, %s now.\n", namebuf, valuebuf);
-      index = nameToIndex (valuebuf);
-      this->mapKeys(namebuf, index[1]);
+  while( iniParser->nextVar (namebuf, valuebuf) != -1)
+  {
+    PRINTF(3)("Keys: Parsing %s, %s now.\n", namebuf, valuebuf);
+    index = nameToIndex (valuebuf);
+    this->mapKeys(namebuf, index[1]);
 
       /*
-      switch( index[0])
-        {
-        case 0:
-          this->mapKeys(namebuf, index[1]);
-          break;
-        case 1:
-          this->mapKeys(namebuf, index[1]);
-          break;
-        default:
-          break;
-        }
+    switch( index[0])
+    {
+    case 0:
+    this->mapKeys(namebuf, index[1]);
+    break;
+    case 1:
+    this->mapKeys(namebuf, index[1]);
+    break;
+    default:
+    break;
+  }
       */
-      memset (namebuf, 0, 256);
-      memset (valuebuf, 0, 256);
-    }
+    memset (namebuf, 0, 256);
+    memset (valuebuf, 0, 256);
+  }
 
 
   // PARSE MISC SECTION
-  if( parser.getSection (CONFIG_SECTION_MISC_KEYS) == -1)
-    {
-      PRINTF(1)("Could not find key bindings in %s\n", fileName);
-      return;
-    }
-
-  while( parser.nextVar (namebuf, valuebuf) != -1)
-    {
-      PRINTF(3)("MISC: Parsing %s, %s now.\n", namebuf, valuebuf);
-      index = nameToIndex (valuebuf);
-      this->mapKeys(namebuf, index[1]);
+  if( iniParser->getSection (CONFIG_SECTION_MISC_KEYS) == -1)
+  {
+    PRINTF(1)("Could not find key bindings\n");
+    return;
+  }
+
+  while( iniParser->nextVar (namebuf, valuebuf) != -1)
+  {
+    PRINTF(3)("MISC: Parsing %s, %s now.\n", namebuf, valuebuf);
+    index = nameToIndex (valuebuf);
+    this->mapKeys(namebuf, index[1]);
       /*
-      switch( index[0])
-        {
-        case 0:
-          this->mapKeys(namebuf, index[1]);
-          break;
-        case 1:
-        this->mapKeys(namebuf, index[1]);
-          break;
-        default:
-          break;
-        }
+    switch( index[0])
+    {
+    case 0:
+    this->mapKeys(namebuf, index[1]);
+    break;
+    case 1:
+    this->mapKeys(namebuf, index[1]);
+    break;
+    default:
+    break;
+  }
       */
-      memset (namebuf, 0, 256);
-      memset (valuebuf, 0, 256);
-    }
-}
-
+    memset (namebuf, 0, 256);
+    memset (valuebuf, 0, 256);
+  }
+}
 
 /**
Index: orxonox/trunk/src/lib/event/key_mapper.h
===================================================================
--- orxonox/trunk/src/lib/event/key_mapper.h	(revision 4864)
+++ orxonox/trunk/src/lib/event/key_mapper.h	(revision 4866)
@@ -1,3 +1,3 @@
-/*! 
+/*!
     \file key_mapper.h
   *  a construct to map player defined keys to SDL keys
@@ -12,4 +12,5 @@
 #include "event_def.h"
 
+class IniParser;
 
 //! A mapping from key-name to key-id
@@ -29,4 +30,5 @@
 
   void loadKeyBindings(const char* fileName = DEFAULT_CONFIG_FILE);
+  void loadKeyBindings(IniParser* iniParser);
 
   void debug();
@@ -41,8 +43,8 @@
   static int PEV_LEFT;              //!< left button
   static int PEV_RIGHT;             //!< right button
-  
+
   static int PEV_STRAFE_LEFT;       //!< strafe left button
   static int PEV_STRAFE_RIGHT;      //!< strafe right button
-  
+
   static int PEV_FIRE1;             //!< fire button 1
   static int PEV_FIRE2;             //!< fire button 2
