Index: code/branches/input/cmake/FindTCL.cmake
===================================================================
--- code/branches/input/cmake/FindTCL.cmake	(revision 1193)
+++ code/branches/input/cmake/FindTCL.cmake	(revision 1193)
@@ -0,0 +1,52 @@
+# - Find Tcl includes and libraries.
+# This module finds if TCL is installed and determines where the
+# include files and libraries are. It also determines what the name of
+# the library is. This code sets the following variables:
+#  TCL_LIBRARY        = path to Tcl library (tcl tcl80)
+#  TCL_INCLUDE_PATH   = path to where tcl.h can be found
+
+GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
+
+SET (TCLTK_POSSIBLE_LIB_PATHS
+  /usr/lib 
+  /usr/local/lib
+  "$ENV{ProgramFiles}/Tcl/Lib"
+  "C:/Program Files/Tcl/lib" 
+  "C:/Tcl/lib" 
+  ../libs/tcl8.5.2/unix
+  ../libs/tcl8.5.2/win
+)
+
+FIND_LIBRARY(TCL_LIBRARY
+  NAMES tcl tcl85 tcl8.5 tcl84 tcl8.4 tcl83 tcl8.3 tcl82 tcl8.2 tcl80 tcl8.0
+  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+)
+
+GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+
+SET (TCLTK_POSSIBLE_INCLUDE_PATHS
+  /usr/include
+  /usr/local/include
+  /usr/include/tcl8.4
+  /usr/include/tcl8.3
+  /usr/include/tcl8.2
+  /usr/include/tcl8.0
+  "$ENV{ProgramFiles}/Tcl/include"
+  "C:/Program Files/Tcl/include"
+  C:/Tcl/include
+  ../libs/tcl8.5.2/generic
+)
+
+FIND_PATH(TCL_INCLUDE_PATH tcl.h
+  ${TCL_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+)
+
+IF(TCL_INCLUDE_PATH)
+  IF(TK_INCLUDE_PATH)
+    IF(TCL_LIBRARY)
+      IF(TK_LIBRARY)
+        SET(TCL_FOUND 1)
+      ENDIF(TK_LIBRARY)
+    ENDIF(TCL_LIBRARY)
+  ENDIF(TK_INCLUDE_PATH)
+ENDIF(TCL_INCLUDE_PATH)
Index: code/branches/input/src/core/Debug.h
===================================================================
--- code/branches/input/src/core/Debug.h	(revision 1191)
+++ code/branches/input/src/core/Debug.h	(revision 1193)
@@ -264,4 +264,10 @@
 ///  CCOUT: Prints output with std::cout and adds the classname   ///
 /////////////////////////////////////////////////////////////////////
+#define CCOUTORX_NONE    CCOUT0
+#define CCOUTORX_ERROR   CCOUT1
+#define CCOUTORX_WARNING CCOUT2
+#define CCOUTORX_INFO    CCOUT3
+#define CCOUTORX_DEBUG   CCOUT4
+#define CCOUTORX_vDEBUG  CCOUT5
 
 #define CCOUT_EXEC(x) \
Index: code/branches/input/src/core/InputBuffer.h
===================================================================
--- code/branches/input/src/core/InputBuffer.h	(revision 1191)
+++ code/branches/input/src/core/InputBuffer.h	(revision 1193)
@@ -35,9 +35,5 @@
 #include <list>
 
-#ifdef WIN32
 #include <OIS/OISKeyboard.h>
-#else
-#include <OISKeyboard.h>
-#endif
 
 namespace orxonox
Index: code/branches/input/src/core/InputManager.cc
===================================================================
--- code/branches/input/src/core/InputManager.cc	(revision 1191)
+++ code/branches/input/src/core/InputManager.cc	(revision 1193)
@@ -28,7 +28,7 @@
 
 /**
- @file
- @brief Implementation of a little Input handler that distributes everything
-        coming from OIS.
+  @file
+  @brief Implementation of the InputManager that captures all the input from OIS
+         and redirects it to listeners if necessary.
  */
 
@@ -42,6 +42,11 @@
 namespace orxonox
 {
-  /**
-    @brief Constructor only resets the pointer values to 0.
+  // ###############################
+  // ###    Internal Methods     ###
+  // ###############################
+
+  /**
+    @brief Constructor only sets member fields to initial zero values
+           and registers the class in the class hierarchy.
   */
   InputManager::InputManager() :
@@ -49,4 +54,8 @@
       state_(IS_UNINIT), stateRequest_(IS_UNINIT)
   {
+    // overwrite every key binding with ""
+    _clearBindings();
+    _setNumberOfJoysticks(0);
+
     RegisterObject(InputManager);
   }
@@ -63,5 +72,5 @@
 
   /**
-    @brief Destructor only called at the end of the program
+    @brief Destructor only called at the end of the program, after main.
   */
   InputManager::~InputManager()
@@ -71,15 +80,17 @@
 
   /**
-    @brief Creates the OIS::InputMananger, the keyboard and the mouse and
-           assigns the key bindings.
+    @brief Creates the OIS::InputMananger, the keyboard, the mouse and
+           the joysticks and assigns the key bindings.
     @param windowHnd The window handle of the render window
     @param windowWidth The width of the render window
     @param windowHeight The height of the render window
   */
-  bool InputManager::_initialise(size_t windowHnd, int windowWidth, int windowHeight)
-  {
-    if (!inputSystem_)
-    {
-      // Setup basic variables
+  bool InputManager::_initialise(size_t windowHnd, int windowWidth, int windowHeight,
+        bool createKeyboard, bool createMouse, bool createJoySticks)
+  {
+    if (state_ == IS_UNINIT)
+    {
+      CCOUT(ORX_DEBUG) << "Initialising OIS components..." << std::endl;
+
       OIS::ParamList paramList;
       std::ostringstream windowHndStr;
@@ -95,84 +106,271 @@
       try
       {
-        // Create inputsystem
         inputSystem_ = OIS::InputManager::createInputSystem(paramList);
-        COUT(ORX_DEBUG) << "*** InputManager: Created OIS input system" << std::endl;
-
-        // create a keyboard. If none are available the exception is caught.
-        keyboard_ = static_cast<OIS::Keyboard*>(inputSystem_->createInputObject(OIS::OISKeyboard, true));
-        COUT(ORX_DEBUG) << "*** InputManager: Created OIS mouse" << std::endl;
-
-        //TODO: check for already pressed keys
-
-        // create a mouse. If none are available the exception is caught.
-        mouse_ = static_cast<OIS::Mouse*>(inputSystem_->createInputObject(OIS::OISMouse, true));
-        COUT(ORX_DEBUG) << "*** InputManager: Created OIS keyboard" << std::endl;
-
-        // Set mouse region
-        setWindowExtents(windowWidth, windowHeight);
-
-        this->state_ = IS_NONE;
+        CCOUT(ORX_DEBUG) << "Created OIS input system" << std::endl;
       }
       catch (OIS::Exception ex)
       {
-        // something went wrong with the initialisation
-        COUT(ORX_ERROR) << "Error: Failed creating an input system/keyboard/mouse. Message: \"" << ex.eText << "\"" << std::endl;
+        CCOUT(ORX_ERROR) << "Error: Failed creating an OIS input system."
+            << "OIS message: \"" << ex.eText << "\"" << std::endl;
         inputSystem_ = 0;
         return false;
       }
-    }
-
-    keyboard_->setEventCallback(this);
-    mouse_->setEventCallback(this);
-
+
+      if (createKeyboard)
+        _initialiseKeyboard();
+
+      if (createMouse)
+        _initialiseMouse();
+
+      if (createJoySticks)
+        _initialiseJoySticks();
+
+      // Set mouse/joystick region
+      setWindowExtents(windowWidth, windowHeight);
+
+      this->state_ = IS_NONE;
+      CCOUT(ORX_DEBUG) << "Initialising OIS components done." << std::endl;
+    }
+    else
+    {
+      CCOUT(ORX_WARNING) << "Warning: OIS compoments already initialised, skipping" << std::endl;
+    }
+
+    // InputManager holds the input buffer --> create one and add it.
     addKeyListener(new InputBuffer(), "buffer");
 
-    _loadBindings();
-
-    COUT(ORX_DEBUG) << "*** InputManager: Loading done." << std::endl;
-
-    return true;
-  }
-
-  void InputManager::_loadBindings()
-  {
-    for (int i = 0; i < numberOfKeys_s; i++)
-    {
-      // simply write the key number (i) in the string
-      this->bindingsKeyPress_[i] = "";
-      this->bindingsKeyRelease_[i] = "";
-    }
+    // Read all the key bindings and assign them
+    if (!_loadBindings())
+      return false;
+
+    CCOUT(ORX_DEBUG) << "Initialising complete." << std::endl;
+    return true;
+  }
+
+  /**
+    @brief Creates a keyboard and sets the event handler.
+  */
+  void InputManager::_initialiseKeyboard()
+  {
+    try
+    {
+#if (OIS_VERSION >> 8) == 0x0100
+    if (inputSystem_->numKeyboards() > 0)
+#elif (OIS_VERSION >> 8) == 0x0102
+    if (inputSystem_->getNumberOfDevices(OIS::OISKeyboard) > 0)
+#endif
+      {
+        keyboard_ = (OIS::Keyboard*)inputSystem_->createInputObject(OIS::OISKeyboard, true);
+        // register our listener in OIS.
+        keyboard_->setEventCallback(this);
+        // note: OIS will not detect keys that have already been down when the keyboard was created.
+        CCOUT(ORX_DEBUG) << "Created OIS keyboard" << std::endl;
+      }
+      else
+        CCOUT(ORX_WARNING) << "Warning: No keyboard found!" << std::endl;
+    }
+    catch (OIS::Exception ex)
+    {
+      CCOUT(ORX_WARNING) << "Warning: Failed to create an OIS keyboard\n"
+          << "OIS error message: \"" << ex.eText << "\"" << std::endl;
+      keyboard_ = 0;
+    }
+  }
+
+  /**
+    @brief Creates a mouse and sets the event handler.
+  */
+  void InputManager::_initialiseMouse()
+  {
+    try
+    {
+#if (OIS_VERSION >> 8) == 0x0100
+    if (inputSystem_->numMice() > 0)
+#elif (OIS_VERSION >> 8) == 0x0102
+    if (inputSystem_->getNumberOfDevices(OIS::OISMouse) > 0)
+#endif
+      {
+        mouse_ = static_cast<OIS::Mouse*>(inputSystem_->createInputObject(OIS::OISMouse, true));
+        // register our listener in OIS.
+        mouse_->setEventCallback(this);
+        CCOUT(ORX_DEBUG) << "Created OIS keyboard" << std::endl;
+      }
+      else
+        CCOUT(ORX_WARNING) << "Warning: No mouse found!" << std::endl;
+    }
+    catch (OIS::Exception ex)
+    {
+      CCOUT(ORX_WARNING) << "Warning: Failed to create an OIS mouse\n"
+          << "OIS error message: \"" << ex.eText << "\"" << std::endl;
+      mouse_ = 0;
+    }
+  }
+
+  /**
+    @brief Creates all joy sticks and sets the event handler.
+  */
+  void InputManager::_initialiseJoySticks()
+  {
+#if (OIS_VERSION >> 8) == 0x0100
+    if (inputSystem_->numJoySticks() > 0)
+    {
+      _setNumberOfJoysticks(inputSystem_->numJoySticks());
+#elif (OIS_VERSION >> 8) == 0x0102
+    if (inputSystem_->getNumberOfDevices(OIS::OISJoyStick) > 0)
+    {
+      _setNumberOfJoysticks(inputSystem_->getNumberOfDevices(OIS::OISJoyStick));
+#endif
+      for (std::vector<OIS::JoyStick*>::iterator it = joySticks_.begin(); it != joySticks_.end(); it++)
+      {
+        try
+        {
+          *it = static_cast<OIS::JoyStick*>(inputSystem_->createInputObject(OIS::OISJoyStick, true));
+          // register our listener in OIS.
+          (*it)->setEventCallback(this);
+          CCOUT(ORX_DEBUG) << "Created OIS joy stick with ID " << (*it)->getID() << std::endl;
+        }
+        catch (OIS::Exception ex)
+        {
+          CCOUT(ORX_WARNING) << "Warning: Failed to create OIS joy stick with ID" << (*it)->getID() << "\n"
+              << "OIS error message: \"" << ex.eText << "\"" << std::endl;
+          (*it) = 0;
+        }
+      }
+    }
+    else
+      CCOUT(ORX_WARNING) << "Warning: Joy stick support requested, but no joy stick was found" << std::endl;
+  }
+
+  /**
+    @brief Resizes all lists related to joy sticks and sets joy stick bindings to "".
+    @param size Number of joy sticks available.
+  */
+  void InputManager::_setNumberOfJoysticks(int size)
+  {
+    this->bindingsJoyStickButtonHold_   .resize(size);
+    this->bindingsJoyStickButtonPress_  .resize(size);
+    this->bindingsJoyStickButtonRelease_.resize(size);
+    this->bJoyStickButtonBindingsActive_.resize(size);
+    this->joyStickButtonsDown_          .resize(size);
+    this->joySticks_                    .resize(size);
+    for (int j = 0; j < size; j++)
+    {
+      bindingsJoyStickButtonPress_  [j].resize(numberOfJoyStickButtons_s);
+      bindingsJoyStickButtonRelease_[j].resize(numberOfJoyStickButtons_s);
+      bindingsJoyStickButtonHold_   [j].resize(numberOfJoyStickButtons_s);
+      for (int i = 0; i < numberOfJoyStickButtons_s; i++)
+      {
+        this->bindingsJoyStickButtonPress_  [j][i] = "";
+        this->bindingsJoyStickButtonRelease_[j][i] = "";
+        this->bindingsJoyStickButtonHold_   [j][i] = "";
+      }
+    }
+  }
+
+  /**
+    @brief Loads the key and button bindings.
+  */
+  bool InputManager::_loadBindings()
+  {
+    CCOUT(ORX_DEBUG) << "Loading key bindings..." << std::endl;
+
+    // clear all the bindings at first.
+    _clearBindings();
+
+    // TODO: Insert the code to load the bindings from file.
     this->bindingsKeyPress_[OIS::KC_NUMPADENTER] = "activateConsole";
     this->bindingsKeyPress_[OIS::KC_ESCAPE] = "exit";
     this->bindingsKeyHold_[OIS::KC_U] = "exec disco.txt";
-  }
-
-  /**
-    @brief Destroys all the created input devices and handlers.
+
+    CCOUT(ORX_DEBUG) << "Loading key bindings done." << std::endl;
+    return true;
+  }
+
+  /**
+    @brief Overwrites all bindings with ""
+  */
+  void InputManager::_clearBindings()
+  {
+    for (int i = 0; i < numberOfKeys_s; i++)
+    {
+      this->bindingsKeyPress_  [i] = "";
+      this->bindingsKeyRelease_[i] = "";
+      this->bindingsKeyHold_   [i] = "";
+    }
+    for (int i = 0; i < numberOfMouseButtons_s; i++)
+    {
+      this->bindingsMouseButtonPress_  [i] = "";
+      this->bindingsMouseButtonRelease_[i] = "";
+      this->bindingsMouseButtonHold_   [i] = "";
+    }
+    for (unsigned int j = 0; j < joySticks_.size(); j++)
+    {
+      for (int i = 0; i < numberOfJoyStickButtons_s; i++)
+      {
+        this->bindingsJoyStickButtonPress_  [j][i] = "";
+        this->bindingsJoyStickButtonRelease_[j][i] = "";
+        this->bindingsJoyStickButtonHold_   [j][i] = "";
+      }
+    }
+  }
+
+  /**
+    @brief Destroys all the created input devices and sets the InputManager to construction state.
   */
   void InputManager::_destroy()
   {
-    COUT(ORX_DEBUG) << "*** InputManager: Destroying ..." << std::endl;
-    if (mouse_)
-      inputSystem_->destroyInputObject(mouse_);
-    if (keyboard_)
-      inputSystem_->destroyInputObject(keyboard_);
-    if (inputSystem_)
-      OIS::InputManager::destroyInputSystem(inputSystem_);
-
-    mouse_         = 0;
-    keyboard_      = 0;
-    inputSystem_   = 0;
-
-    OIS::KeyListener* buffer = keyListeners_["buffer"];
-    if (buffer)
-    {
-      this->removeKeyListener("buffer");
-      delete buffer;
-      buffer = 0;
-    }
-
-    COUT(ORX_DEBUG) << "*** InputManager: Destroying done." << std::endl;
-  }
+    CCOUT(ORX_DEBUG) << "Destroying ..." << std::endl;
+
+    if (state_ != IS_UNINIT)
+    {
+      this->listenersKeyActive_.clear();
+      this->listenersMouseActive_.clear();
+      this->listenersJoySticksActive_.clear();
+      this->listenersKey_.clear();
+      this->listenersMouse_.clear();
+      this->listenersJoySticks_.clear();
+
+      this->keysDown_.clear();
+      this->mouseButtonsDown_.clear();
+
+      _clearBindings();
+
+      if (keyboard_)
+        inputSystem_->destroyInputObject(keyboard_);
+      keyboard_ = 0;
+
+      if (mouse_)
+        inputSystem_->destroyInputObject(mouse_);
+      mouse_ = 0;
+
+      if (joySticks_.size() > 0)
+      {
+        for (unsigned int i = 0; i < joySticks_.size(); i++)
+        {
+          if (joySticks_[i] != 0)
+            inputSystem_->destroyInputObject(joySticks_[i]);
+        }
+        _setNumberOfJoysticks(0);
+      }
+
+      if (inputSystem_)
+        OIS::InputManager::destroyInputSystem(inputSystem_);
+      inputSystem_ = 0;
+
+      if (listenersKey_.find("buffer") != listenersKey_.end())
+        delete listenersKey_["buffer"];
+
+      this->state_ = IS_UNINIT;
+    }
+    else
+      CCOUT(ORX_WARNING) << "Warning: Cannot be destroyed, since not initialised." << std::endl;
+
+    CCOUT(ORX_DEBUG) << "Destroying done." << std::endl;
+  }
+
+
+  // ###############################
+  // ###  Public Member Methods  ###
+  // ###############################
 
   /**
@@ -188,19 +386,45 @@
     if (state_ != stateRequest_)
     {
-      if (stateRequest_ != IS_CUSTOM)
-        _setDefaultState();
-
       switch (stateRequest_)
       {
       case IS_NORMAL:
+        this->listenersKeyActive_.clear();
+        this->listenersMouseActive_.clear();
+        this->listenersJoySticksActive_.clear();
+        this->bKeyBindingsActive_            = true;
+        this->bMouseButtonBindingsActive_    = true;
+        //this->bJoySticksButtonBindingsActive_ = true;
         break;
+
       case IS_GUI:
-        //FIXME: do stuff
+        // FIXME: do stuff
         break;
+
       case IS_CONSOLE:
-        if (this->keyListeners_.find("buffer") != this->keyListeners_.end())
-          this->activeKeyListeners_.push_back(this->keyListeners_["buffer"]);
-        this->bDefaultKeyInput = false;
+        this->listenersKeyActive_.clear();
+        this->listenersMouseActive_.clear();
+        //this->listenersJoyStickActive_.clear();
+        this->bKeyBindingsActive_            = false;
+        this->bMouseButtonBindingsActive_    = true;
+        //this->bJoyStickButtonBindingsActive_ = true;
+        if (listenersKey_.find("buffer") != listenersKey_.end())
+          listenersKeyActive_.push_back(listenersKey_["buffer"]);
+        else
+        {
+          // someone fiddled with the InputBuffer
+          CCOUT(2) << "Error: Cannot redirect input to console, InputBuffer instance missing." << std::endl;
+          this->bKeyBindingsActive_ = true;
+        }
         break;
+
+      case IS_NONE:
+        this->listenersKeyActive_.clear();
+        this->listenersMouseActive_.clear();
+        //this->listenersJoyStickActive_.clear();
+        this->bKeyBindingsActive_            = false;
+        this->bMouseButtonBindingsActive_    = false;
+        //this->bJoyStickButtonBindingsActive_ = false;
+        break;
+
       case IS_CUSTOM:
         // don't do anything
@@ -210,5 +434,5 @@
     }
 
-    // capture all the input. That calls the event handlers.
+    // Capture all the input. This calls the event handlers in InputManager.
     if (mouse_)
       mouse_->capture();
@@ -217,13 +441,13 @@
   }
 
-  void InputManager::_setDefaultState()
-  {
-    this->activeJoyStickListeners_.clear();
-    this->activeKeyListeners_.clear();
-    this->activeMouseListeners_.clear();
-    this->bDefaultKeyInput      = true;
-    this->bDefaultMouseInput    = true;
-    this->bDefaultJoyStickInput = true;
-  }
+  /*void InputManager::_setDefaultState()
+  {
+    this->listenersKeyActive_.clear();
+    this->listenersMouseActive_.clear();
+    this->listenersJoyStickActive_.clear();
+    this->bKeyBindingsActive_            = true;
+    this->bMouseButtonBindingsActive_    = true;
+    this->bJoyStickButtonBindingsActive_ = true;
+  }*/
 
 
@@ -236,5 +460,5 @@
     this->keysDown_.push_back(e.key);
 
-    if (this->bDefaultKeyInput)
+    if (this->bKeyBindingsActive_)
     {
       // find the appropriate key binding
@@ -248,5 +472,5 @@
     else
     {
-      for (std::list<OIS::KeyListener*>::const_iterator it = activeKeyListeners_.begin(); it != activeKeyListeners_.end(); it++)
+      for (std::list<OIS::KeyListener*>::const_iterator it = listenersKeyActive_.begin(); it != listenersKeyActive_.end(); it++)
         (*it)->keyPressed(e);
     }
@@ -270,5 +494,5 @@
     }
 
-    if (this->bDefaultKeyInput)
+    if (this->bKeyBindingsActive_)
     {
       // find the appropriate key binding
@@ -282,5 +506,5 @@
     else
     {
-      for (std::list<OIS::KeyListener*>::const_iterator it = activeKeyListeners_.begin(); it != activeKeyListeners_.end(); it++)
+      for (std::list<OIS::KeyListener*>::const_iterator it = listenersKeyActive_.begin(); it != listenersKeyActive_.end(); it++)
         (*it)->keyReleased(e);
     }
@@ -343,4 +567,7 @@
 
 
+  // ################################
+  // ### Static Interface Methods ###
+  // ################################
 
   /**
@@ -352,8 +579,11 @@
   void InputManager::setWindowExtents(int width, int height)
   {
-    // Set mouse region (if window resizes, we should alter this to reflect as well)
-    const OIS::MouseState &mouseState = _getSingleton().mouse_->getMouseState();
-    mouseState.width  = width;
-    mouseState.height = height;
+    if (_getSingleton().mouse_)
+    {
+      // Set mouse region (if window resizes, we should alter this to reflect as well)
+      const OIS::MouseState &mouseState = _getSingleton().mouse_->getMouseState();
+      mouseState.width  = width;
+      mouseState.height = height;
+    }
   }
 
@@ -382,14 +612,16 @@
   }
 
-  bool InputManager::initialise(size_t windowHnd, int windowWidth, int windowHeight)
-  {
-    return _getSingleton()._initialise(windowHnd, windowWidth, windowHeight);
+  bool InputManager::initialise(size_t windowHnd, int windowWidth, int windowHeight,
+    bool createKeyboard, bool createMouse, bool createJoySticks)
+  {
+    return _getSingleton()._initialise(windowHnd, windowWidth, windowHeight,
+          createKeyboard, createMouse, createJoySticks);
   }
 
   bool InputManager::addKeyListener(OIS::KeyListener *listener, const std::string& name)
   {
-    if (_getSingleton().keyListeners_.find(name) == _getSingleton().keyListeners_.end())
-    {
-      _getSingleton().keyListeners_[name] = listener;
+    if (_getSingleton().listenersKey_.find(name) == _getSingleton().listenersKey_.end())
+    {
+      _getSingleton().listenersKey_[name] = listener;
       return true;
     }
@@ -400,8 +632,8 @@
   bool InputManager::removeKeyListener(const std::string &name)
   {
-    std::map<std::string, OIS::KeyListener*>::iterator it = _getSingleton().keyListeners_.find(name);
-    if (it != _getSingleton().keyListeners_.end())
-    {
-      _getSingleton().keyListeners_.erase(it);
+    std::map<std::string, OIS::KeyListener*>::iterator it = _getSingleton().listenersKey_.find(name);
+    if (it != _getSingleton().listenersKey_.end())
+    {
+      _getSingleton().listenersKey_.erase(it);
       return true;
     }
@@ -412,6 +644,6 @@
   OIS::KeyListener* InputManager::getKeyListener(const std::string& name)
   {
-    std::map<std::string, OIS::KeyListener*>::iterator it = _getSingleton().keyListeners_.find(name);
-    if (it != _getSingleton().keyListeners_.end())
+    std::map<std::string, OIS::KeyListener*>::iterator it = _getSingleton().listenersKey_.find(name);
+    if (it != _getSingleton().listenersKey_.end())
     {
       return (*it).second;
Index: code/branches/input/src/core/InputManager.h
===================================================================
--- code/branches/input/src/core/InputManager.h	(revision 1191)
+++ code/branches/input/src/core/InputManager.h	(revision 1193)
@@ -56,54 +56,53 @@
           public OIS::MouseListener, public OIS::KeyListener, public OIS::JoyStickListener
   {
-  public:
+  public: // enumerations
     /**
-      @brief Designates the way input is handled currently.
-      IM_GUI:    All the OIS input events are passed to CEGUI
-      IM_BUFFER: Only keyboard input is captured and passed to the InputBuffer
-      IM_NORMAL: Normal game mode. Key bindings and mouse are active.
+      @brief Designates the way input is handled and redirected.
     */
     enum InputState
     {
-      IS_UNINIT,
-      IS_NONE,
-      IS_NORMAL,
-      IS_GUI,
-      IS_CONSOLE,
-      IS_CUSTOM
+      IS_UNINIT,  //!< InputManager has not yet been initialised.
+      IS_NONE,    //!< Input is discarded.
+      IS_NORMAL,  //!< Normal play state. Key and button bindings are active.
+      IS_GUI,     //!< All OIS input events are passed to CEGUI.
+      IS_CONSOLE, //!< Keyboard input is redirected to the InputBuffer.
+      IS_CUSTOM   //!< Any possible configuration.
     };
 
-  public:
-    void tick(float dt);
-
-    static bool initialise(size_t windowHnd, int windowWidth, int windowHeight);
+  public: // functions
+    // METHODS OF THE STATIC INTERFACE
+
+    static bool initialise(size_t windowHnd, int windowWidth, int windowHeight,
+          bool createKeyboard = true, bool createMouse = true, bool createJoySticks = false);
     static void destroy();
 
     static void setWindowExtents(int width, int height);
+
     static void setInputState(const InputState state);
     static InputState getInputState();
+    static void setKeyBindingState           (bool bActive);
+    static void setMouseButtonBindingState   (bool bActive);
+    static void setJoyStickButtonBindingState(bool bActive);
 
     static bool addKeyListener(OIS::KeyListener* listener, const std::string& name);
-    //static bool removeKeyListener(OIS::KeyListener* listener);
-    static bool removeKeyListener(const std::string& name);
-    static bool enableKeyListener(const std::string& name);
-    static bool disableKeyListener(const std::string& name);
+    static bool removeKeyListener  (const std::string& name);
+    static bool enableKeyListener  (const std::string& name);
+    static bool disableKeyListener (const std::string& name);
+    static bool isKeyListenerActive(const std::string& name);
     static OIS::KeyListener* getKeyListener(const std::string& name);
-    static bool isKeyListenerActive(const std::string& name);
 
     static bool addMouseListener(OIS::MouseListener* listener, const std::string& name);
-    //static bool removeMouseListener(OIS::MouseListener* listener);
-    static bool removeMouseListener(const std::string& name);
-    static bool enableMouseListener(const std::string& name);
-    static bool disableMouseListener(const std::string& name);
+    static bool removeMouseListener  (const std::string& name);
+    static bool enableMouseListener  (const std::string& name);
+    static bool disableMouseListener (const std::string& name);
+    static bool isMouseListenerActive(const std::string& name);
     static OIS::MouseListener* getMouseListener(const std::string& name);
-    static bool isMouseListenerActive(const std::string& name);
 
     static bool addJoyStickListener(OIS::JoyStickListener* listener, const std::string& name);
-    //static bool removeJoyStickListener(OIS::JoyStickListener* listener);
-    static bool removeJoyStickListener(const std::string& name);
-    static bool enableJoyStickListener(const std::string& name);
-    static bool disableJoyStickListener(const std::string& name);
+    static bool removeJoyStickListener  (const std::string& name);
+    static bool enableJoyStickListener  (const std::string& name);
+    static bool disableJoyStickListener (const std::string& name);
+    static bool isJoyStickListenerActive(const std::string& name);
     static OIS::JoyStickListener* getJoyStickListener(const std::string& name);
-    static bool isJoyStickListenerActive(const std::string& name);
 
     // Temporary solutions. Will be removed soon!
@@ -111,5 +110,5 @@
     static OIS::Keyboard* getKeyboard() { return _getSingleton().keyboard_; }
 
-  private:
+  private: // functions
     // don't mess with a Singleton
     InputManager ();
@@ -117,8 +116,16 @@
     ~InputManager();
 
-    bool _initialise(size_t windowHnd, int windowWidth, int windowHeight);
+    // Intenal methods
+    bool _initialise(size_t, int, int, bool, bool, bool);
+    void _initialiseKeyboard();
+    void _initialiseMouse();
+    void _initialiseJoySticks();
     void _destroy();
-    void _setDefaultState();
-    void _loadBindings();
+    //void _setDefaultState();
+    bool _loadBindings();
+    void _clearBindings();
+    void _setNumberOfJoysticks(int size);
+
+    void tick(float dt);
 
     // input events
@@ -137,28 +144,32 @@
     static InputManager* _getSingletonPtr() { return &_getSingleton(); }
 
-  private:
+  private: // variables
     OIS::InputManager* inputSystem_;    //!< OIS input manager
     OIS::Keyboard*     keyboard_;       //!< OIS mouse
     OIS::Mouse*        mouse_;          //!< OIS keyboard
+    std::vector<OIS::JoyStick*> joySticks_;       //!< OIS joy sticks
 
     InputState state_;
     InputState stateRequest_;
 
-    std::list<OIS::KeyCode> keysDown_;
-
-    bool bDefaultKeyInput;
-    bool bDefaultMouseInput;
-    bool bDefaultJoyStickInput;
-
-    std::map<std::string, OIS::KeyListener*>      keyListeners_;
-    std::list<OIS::KeyListener*>                  activeKeyListeners_;
-    std::map<std::string, OIS::MouseListener*>    mouseListeners_;
-    std::list<OIS::MouseListener*>                activeMouseListeners_;
-    std::map<std::string, OIS::JoyStickListener*> joystickListeners_;
-    std::list<OIS::JoyStickListener*>             activeJoyStickListeners_;
+    bool bKeyBindingsActive_;
+    bool bMouseButtonBindingsActive_;
+    std::vector<bool> bJoyStickButtonBindingsActive_;
+
+    std::map<std::string, OIS::KeyListener*>      listenersKey_;
+    std::map<std::string, OIS::MouseListener*>    listenersMouse_;
+    std::map<std::string, OIS::JoyStickListener*> listenersJoySticks_;
+
+    std::list<OIS::KeyListener*>      listenersKeyActive_;
+    std::list<OIS::MouseListener*>    listenersMouseActive_;
+    std::list<OIS::JoyStickListener*> listenersJoySticksActive_;
+
+    std::list<OIS::KeyCode>         keysDown_;
+    std::list<OIS::MouseButtonID>   mouseButtonsDown_;
+    std::vector< std::list<int> >   joyStickButtonsDown_;
 
 
     /** denotes the maximum number of different keys there are in OIS.
-        256 should be ok since the highest number in the enum is 237. */
+        256 should be ok since the highest number in the OIS enum is 237. */
     static const int numberOfKeys_s = 256;
     //! Array of input events for every pressed key
@@ -170,5 +181,5 @@
 
     /** denotes the maximum number of different buttons there are in OIS.
-        16 should be ok since the highest number in the enum is 7. */
+        16 should be ok since the highest number in the OIS enum is 7. */
     static const int numberOfMouseButtons_s = 16;
     //! Array of input events for every pressed mouse button
@@ -182,10 +193,7 @@
         32 should be ok. */
     static const int numberOfJoyStickButtons_s = 32;
-    //! Array of input events for every pressed joystick button
-    std::string bindingsJoyStickButtonPress_  [numberOfJoyStickButtons_s];
-    //! Array of input events for every released joystick button
-    std::string bindingsJoyStickButtonRelease_[numberOfJoyStickButtons_s];
-    //! Array of input events for every held joystick button
-    std::string bindingsJoyStickButtonHold_   [numberOfJoyStickButtons_s];
+    std::vector< std::vector< std::string > > bindingsJoyStickButtonPress_;
+    std::vector< std::vector< std::string > > bindingsJoyStickButtonRelease_;
+    std::vector< std::vector< std::string > > bindingsJoyStickButtonHold_;
 
   };
Index: code/branches/input/src/util/tolua/tolua_bind.cc
===================================================================
--- code/branches/input/src/util/tolua/tolua_bind.cc	(revision 1191)
+++ 	(revision )
@@ -1,110 +1,0 @@
-/*
-** Lua binding: orxonox
-** Generated automatically by tolua++-1.0.92 on Tue Apr 22 10:52:02 2008.
-*/
-
-#ifndef __cplusplus
-#include "stdlib.h"
-#endif
-#include "string.h"
-
-#include "tolua++.h"
-
-/* Exported function */
-TOLUA_API int  tolua_orxonox_open (lua_State* tolua_S);
-
-#include "core/Script_clean.h"
-
-/* function to register type */
-static void tolua_reg_types (lua_State* tolua_S)
-{
- tolua_usertype(tolua_S,"orxonox::Script");
-}
-
-/* method: getInstance of class  orxonox::Script */
-#ifndef TOLUA_DISABLE_tolua_orxonox_orxonox_Script_getInstance00
-static int tolua_orxonox_orxonox_Script_getInstance00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
-     !tolua_isusertable(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
-  goto tolua_lerror;
- else
-#endif
- {
-  {
-   orxonox::Script* tolua_ret = (orxonox::Script*)  orxonox::Script::getInstance();
-   tolua_pushusertype(tolua_S,(void*)tolua_ret,"orxonox::Script");
-  }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'getInstance'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: luaPrint of class  orxonox::Script */
-#ifndef TOLUA_DISABLE_tolua_orxonox_orxonox_Script_luaPrint00
-static int tolua_orxonox_orxonox_Script_luaPrint00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
-     !tolua_isusertype(tolua_S,1,"orxonox::Script",0,&tolua_err) ||
-     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
-  goto tolua_lerror;
- else
-#endif
- {
-  orxonox::Script* self = (orxonox::Script*)  tolua_tousertype(tolua_S,1,0);
-  std::string str = ((std::string)  tolua_tocppstring(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
-  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'luaPrint'",NULL);
-#endif
-  {
-   self->luaPrint(str);
-  }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'luaPrint'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* Open function */
-TOLUA_API int tolua_orxonox_open (lua_State* tolua_S)
-{
- tolua_open(tolua_S);
- tolua_reg_types(tolua_S);
- tolua_module(tolua_S,NULL,0);
- tolua_beginmodule(tolua_S,NULL);
-  tolua_module(tolua_S,"orxonox",0);
-  tolua_beginmodule(tolua_S,"orxonox");
-   tolua_cclass(tolua_S,"Script","orxonox::Script","",NULL);
-   tolua_beginmodule(tolua_S,"Script");
-    tolua_function(tolua_S,"getInstance",tolua_orxonox_orxonox_Script_getInstance00);
-    tolua_function(tolua_S,"luaPrint",tolua_orxonox_orxonox_Script_luaPrint00);
-   tolua_endmodule(tolua_S);
-  tolua_endmodule(tolua_S);
- tolua_endmodule(tolua_S);
- return 1;
-}
-
-
-#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
- TOLUA_API int luaopen_orxonox (lua_State* tolua_S) {
- return tolua_orxonox_open(tolua_S);
-};
-#endif
-
Index: code/branches/input/src/util/tolua/tolua_bind.h
===================================================================
--- code/branches/input/src/util/tolua/tolua_bind.h	(revision 1191)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
-** Lua binding: orxonox
-** Generated automatically by tolua++-1.0.92 on Tue Apr 22 10:52:02 2008.
-*/
-
-/* Exported function */
-TOLUA_API int  tolua_orxonox_open (lua_State* tolua_S);
-
Index: code/branches/input/src/util/tolua/toluabind_default.h
===================================================================
--- code/branches/input/src/util/tolua/toluabind_default.h	(revision 1191)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
-** Lua binding: tolua
-** Generated automatically by tolua++-1.0.8pre2 on Tue Dec 13 01:43:55 2005.
-*/
-
-/* Exported function */
-TOLUA_API int  tolua_tolua_open (lua_State* tolua_S);
-
Index: code/branches/input/visual_studio/core_properties.vsprops
===================================================================
--- code/branches/input/visual_studio/core_properties.vsprops	(revision 1191)
+++ code/branches/input/visual_studio/core_properties.vsprops	(revision 1193)
@@ -12,5 +12,5 @@
 	<Tool
 		Name="VCLinkerTool"
-		AdditionalDependencies="OgreMain$(CSS).lib OIS$(CS).lib lua51$(CS).lib"
+		AdditionalDependencies="OgreMain$(CSS).lib ois-1.2.0$(CS).lib lua-5.1$(CS).lib"
 	/>
 </VisualStudioPropertySheet>
Index: code/branches/input/visual_studio/orxonox_properties.vsprops
===================================================================
--- code/branches/input/visual_studio/orxonox_properties.vsprops	(revision 1191)
+++ code/branches/input/visual_studio/orxonox_properties.vsprops	(revision 1193)
@@ -14,5 +14,5 @@
 	<Tool
 		Name="VCLinkerTool"
-		AdditionalDependencies="OgreMain$(CSS).lib OIS$(CS).lib"
+		AdditionalDependencies="OgreMain$(CSS).lib ois-1.2.0$(CS).lib"
 		OutputFile="$(OutDir)$(ProjectName)$(CS).exe"
 		IgnoreDefaultLibraryNames=""
Index: code/branches/input/visual_studio/orxonox_vc8.sln
===================================================================
--- code/branches/input/visual_studio/orxonox_vc8.sln	(revision 1191)
+++ code/branches/input/visual_studio/orxonox_vc8.sln	(revision 1193)
@@ -57,5 +57,5 @@
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tolua++", "vc8\tolua++.vcproj", "{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tolua", "vc8\tolua.vcproj", "{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}"
 	ProjectSection(WebsiteProperties) = preProject
 		Debug.AspNetCompiler.Debug = "True"
@@ -102,5 +102,7 @@
 		{2240ECD7-2F48-4431-8E1B-25466A384CCC}.static_libs_release|Win32.ActiveCfg = Release|Win32
 		{F101C2F0-1CB9-4A57-827B-6C399A99B28F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F101C2F0-1CB9-4A57-827B-6C399A99B28F}.Debug|Win32.Build.0 = Debug|Win32
 		{F101C2F0-1CB9-4A57-827B-6C399A99B28F}.Release|Win32.ActiveCfg = Release|Win32
+		{F101C2F0-1CB9-4A57-827B-6C399A99B28F}.Release|Win32.Build.0 = Release|Win32
 		{F101C2F0-1CB9-4A57-827B-6C399A99B28F}.static_libs_debug|Win32.ActiveCfg = Debug|Win32
 		{F101C2F0-1CB9-4A57-827B-6C399A99B28F}.static_libs_debug|Win32.Build.0 = Debug|Win32
@@ -108,5 +110,7 @@
 		{F101C2F0-1CB9-4A57-827B-6C399A99B28F}.static_libs_release|Win32.Build.0 = Release|Win32
 		{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}.Debug|Win32.ActiveCfg = Debug|Win32
+		{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}.Debug|Win32.Build.0 = Debug|Win32
 		{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}.Release|Win32.ActiveCfg = Release|Win32
+		{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}.Release|Win32.Build.0 = Release|Win32
 		{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}.static_libs_debug|Win32.ActiveCfg = Debug|Win32
 		{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}.static_libs_debug|Win32.Build.0 = Debug|Win32
Index: code/branches/input/visual_studio/tolua++_properties.vsprops
===================================================================
--- code/branches/input/visual_studio/tolua++_properties.vsprops	(revision 1191)
+++ 	(revision )
@@ -1,8 +1,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioPropertySheet
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="tolua++_properties"
-	InheritedPropertySheets=".\directory_properties.vsprops"
-	>
-</VisualStudioPropertySheet>
Index: code/branches/input/visual_studio/tolua_properties.vsprops
===================================================================
--- code/branches/input/visual_studio/tolua_properties.vsprops	(revision 1193)
+++ code/branches/input/visual_studio/tolua_properties.vsprops	(revision 1193)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="tolua_properties"
+	InheritedPropertySheets=".\directory_properties.vsprops"
+	>
+	<Tool
+		Name="VCCLCompilerTool"
+		DisableSpecificWarnings="4996"
+	/>
+</VisualStudioPropertySheet>
Index: code/branches/input/visual_studio/vc8/tolua++.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/tolua++.vcproj	(revision 1191)
+++ 	(revision )
@@ -1,170 +1,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="tolua++"
-	ProjectGUID="{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}"
-	RootNamespace="FICN"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(SolutionDir)base_properties_debug.vsprops;..\tolua++_properties.vsprops"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\tolua++_properties.vsprops"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-			>
-			<File
-				RelativePath="..\..\src\util\tolua\tolua_event.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\util\tolua\tolua_is.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\util\tolua\tolua_map.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\util\tolua\tolua_push.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\util\tolua\tolua_to.c"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-			>
-			<File
-				RelativePath="..\..\src\util\tolua\tolua++.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\util\tolua\tolua_event.h"
-				>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
Index: code/branches/input/visual_studio/vc8/tolua.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/tolua.vcproj	(revision 1193)
+++ code/branches/input/visual_studio/vc8/tolua.vcproj	(revision 1193)
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="tolua"
+	ProjectGUID="{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}"
+	RootNamespace="FICN"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(SolutionDir)base_properties_debug.vsprops;..\tolua_properties.vsprops"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(SolutionDir)base_properties_release.vsprops;..\tolua_properties.vsprops"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\src\util\tolua\tolua_event.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\util\tolua\tolua_is.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\util\tolua\tolua_map.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\util\tolua\tolua_push.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\util\tolua\tolua_to.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\..\src\util\tolua\tolua++.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\util\tolua\tolua_event.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
