Index: code/branches/core4/src/core/input/JoyStick.cc
===================================================================
--- code/branches/core4/src/core/input/JoyStick.cc	(revision 3305)
+++ code/branches/core4/src/core/input/JoyStick.cc	(revision 3306)
@@ -43,5 +43,5 @@
     void loadCalibration(std::vector<int>& list, const std::string& sectionName, const std::string& valueName, size_t size, int defaultValue);
 
-    std::vector<std::string> JoyStick::idStrings_s;
+    std::vector<std::string> JoyStick::deviceNames_s;
 
     JoyStick::JoyStick(unsigned int id, OIS::InputManager* oisInputManager)
@@ -53,32 +53,36 @@
         this->clearBuffersImpl();
 
-        idString_ = "JoyStick_";
-        std::string name = oisDevice_->vendor();
-        replaceCharacters(name, ' ', '_');
-        idString_ += name + "_";
-        idString_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_Button))  + "_";
-        idString_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_Axis))    + "_";
-        idString_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_Slider))  + "_";
-        idString_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_POV));
-        //idString_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_Vector3));
-
-
-        BOOST_FOREACH(std::string& idString, idStrings_s)
-        {
-            if (idString_ == idString)
+        // Generate unique name
+        if (oisDevice_->vendor().empty())
+            deviceName_ = "Unknown_";
+        else
+        {
+            std::string name = oisDevice_->vendor();
+            replaceCharacters(name, ' ', '_');
+            deviceName_ = name + "_";
+        }
+        deviceName_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_Button))  + "_";
+        deviceName_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_Axis))    + "_";
+        deviceName_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_Slider))  + "_";
+        deviceName_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_POV));
+        //deviceName_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_Vector3));
+
+        BOOST_FOREACH(std::string& idString, deviceNames_s)
+        {
+            if (deviceName_ == idString)
             {
                 // Make the ID unique for this execution time.
-                idString_ += "_" + multi_cast<std::string>(this->getDeviceID());
+                deviceName_ += "_" + multi_cast<std::string>(this->getDeviceName());
                 break;
             }
         }
 
-        COUT(4) << "Created OIS joy stick with ID " << idString_ << std::endl;
+        COUT(4) << "Created OIS joy stick with ID " << deviceName_ << std::endl;
 
         // Load calibration
         size_t axes = sliderAxes_s + static_cast<size_t>(oisDevice_->getNumberOfComponents(OIS::OIS_Axis));
-        loadCalibration(configMinValues_,  idString_, "MinValue",  axes,  -32768);
-        loadCalibration(configMaxValues_,  idString_, "MaxValue",  axes,   32768);
-        loadCalibration(configZeroValues_, idString_, "ZeroValue", axes, 0);
+        loadCalibration(configMinValues_,  deviceName_, "MinValue",  axes,  -32768);
+        loadCalibration(configMaxValues_,  deviceName_, "MaxValue",  axes,   32768);
+        loadCalibration(configZeroValues_, deviceName_, "ZeroValue", axes, 0);
         this->evaluateCalibration();
     }
@@ -148,5 +152,5 @@
                 configMinValues_[i] = -32768;
             ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
-                idString_, "MinValue", i, multi_cast<std::string>(configMinValues_[i]), false);
+                deviceName_, "MinValue", i, multi_cast<std::string>(configMinValues_[i]), false);
 
             // Maximum values
@@ -154,9 +158,9 @@
                 configMaxValues_[i] = 32767;
             ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
-                idString_, "MaxValue", i, multi_cast<std::string>(configMaxValues_[i]), false);
+                deviceName_, "MaxValue", i, multi_cast<std::string>(configMaxValues_[i]), false);
 
             // Middle values
             ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
-                idString_, "ZeroValue", i, multi_cast<std::string>(configZeroValues_[i]), false);
+                deviceName_, "ZeroValue", i, multi_cast<std::string>(configZeroValues_[i]), false);
         }
 
Index: code/branches/core4/src/core/input/JoyStick.h
===================================================================
--- code/branches/core4/src/core/input/JoyStick.h	(revision 3305)
+++ code/branches/core4/src/core/input/JoyStick.h	(revision 3306)
@@ -71,6 +71,6 @@
         void setConfigValues();
 
-        //! Returns the ID string generated from the number of knobs and the device name
-        const std::string& getIDString() const { return this->idString_; }
+        //! Returns the name generated from the number of knobs and the device name
+        const std::string& getDeviceName() const { return this->deviceName_; }
 
     private:
@@ -106,5 +106,5 @@
         static std::string getClassNameImpl() { return "JoyStick"; }
 
-        std::string idString_;                //!< ID string generated by the number of knobs and the device name
+        std::string deviceName_;              //!< Name generated by the number of knobs and the device name
         int povStates_[4];                    //!< Internal states for the POVs
         int sliderStates_[4][2];              //!< Internal states for the Sliders (each slider has X and Y!)
@@ -122,6 +122,6 @@
         std::string calibrationFilename_;     //!< Joy stick calibration ini filename
 
-        //! Contains a list of all ID strings to avoid duplicates
-        static std::vector<std::string> idStrings_s;
+        //! Contains a list of all names to avoid duplicates
+        static std::vector<std::string> deviceNames_s;
 
         //!< Maximum number of slider axes
Index: code/branches/core4/src/core/input/KeyBinder.cc
===================================================================
--- code/branches/core4/src/core/input/KeyBinder.cc	(revision 3305)
+++ code/branches/core4/src/core/input/KeyBinder.cc	(revision 3306)
@@ -40,4 +40,5 @@
 #include "core/ConfigFileManager.h"
 #include "InputCommands.h"
+#include "JoyStick.h"
 
 namespace orxonox
@@ -48,6 +49,5 @@
     */
     KeyBinder::KeyBinder()
-        : numberOfJoySticks_(0)
-        , deriveTime_(0.0f)
+        : deriveTime_(0.0f)
     {
         mouseRelative_[0] = 0;
@@ -82,5 +82,5 @@
             else
                 nameSuffix = mouseWheelNames[i - MouseButtonCode::numberOfButtons];
-            mouseButtons_[i].name_ = std::string("Mouse") + nameSuffix;
+            mouseButtons_[i].name_ = nameSuffix;
             mouseButtons_[i].paramCommandBuffer_ = &paramCommandBuffer_;
             mouseButtons_[i].groupName_ = "MouseButtons";
@@ -89,5 +89,5 @@
         for (unsigned int i = 0; i < MouseAxisCode::numberOfAxes * 2; i++)
         {
-            mouseAxes_[i].name_ = std::string("Mouse") + MouseAxisCode::ByString[i / 2];
+            mouseAxes_[i].name_ = MouseAxisCode::ByString[i / 2];
             if (i & 1)
                 mouseAxes_[i].name_ += "Pos";
@@ -102,9 +102,5 @@
 
         // initialise joy sticks separatly to allow for reloading
-        numberOfJoySticks_ = this->getJoyStickList().size();
-        initialiseJoyStickBindings();
-
-        // collect all Buttons and HalfAxes
-        compilePointerLists();
+        this->JoyStickQuantityChanged(this->getJoyStickList());
 
         // set them here to use allHalfAxes_
@@ -156,6 +152,6 @@
     void KeyBinder::JoyStickQuantityChanged(const std::vector<JoyStick*>& joyStickList)
     {
-        unsigned int oldValue = numberOfJoySticks_;
-        numberOfJoySticks_ = joyStickList.size();
+        unsigned int oldValue = joySticks_.size();
+        joySticks_ = joyStickList;
 
         // initialise joy stick bindings
@@ -168,5 +164,5 @@
         if (configFile_ != ConfigFileType::NoType)
         {
-            for (unsigned int iDev = oldValue; iDev < numberOfJoySticks_; ++iDev)
+            for (unsigned int iDev = oldValue; iDev < joySticks_.size(); ++iDev)
             {
                 for (unsigned int i = 0; i < JoyStickButtonCode::numberOfButtons; ++i)
@@ -183,22 +179,22 @@
     void KeyBinder::initialiseJoyStickBindings()
     {
-        this->joyStickAxes_.resize(numberOfJoySticks_);
-        this->joyStickButtons_.resize(numberOfJoySticks_);
+        this->joyStickAxes_.resize(joySticks_.size());
+        this->joyStickButtons_.resize(joySticks_.size());
 
         // reinitialise all joy stick binings (doesn't overwrite the old ones)
-        for (unsigned int iDev = 0; iDev < numberOfJoySticks_; iDev++)
-        {
-            std::string deviceNumber = multi_cast<std::string>(iDev);
+        for (unsigned int iDev = 0; iDev < joySticks_.size(); iDev++)
+        {
+            std::string deviceName = joySticks_[iDev]->getDeviceName();
             // joy stick buttons
             for (unsigned int i = 0; i < JoyStickButtonCode::numberOfButtons; i++)
             {
-                joyStickButtons_[iDev][i].name_ = std::string("JoyStick") + deviceNumber + JoyStickButtonCode::ByString[i];
+                joyStickButtons_[iDev][i].name_ = JoyStickButtonCode::ByString[i];
                 joyStickButtons_[iDev][i].paramCommandBuffer_ = &paramCommandBuffer_;
-                joyStickButtons_[iDev][i].groupName_ = std::string("JoyStick") + deviceNumber + "Buttons";
+                joyStickButtons_[iDev][i].groupName_ = "JoyStickButtons_" + deviceName;
             }
             // joy stick axes
             for (unsigned int i = 0; i < JoyStickAxisCode::numberOfAxes * 2; i++)
             {
-                joyStickAxes_[iDev][i].name_ = std::string("JoyStick") + deviceNumber + JoyStickAxisCode::ByString[i >> 1];
+                joyStickAxes_[iDev][i].name_ = JoyStickAxisCode::ByString[i / 2];
                 if (i & 1)
                     joyStickAxes_[iDev][i].name_ += "Pos";
@@ -206,5 +202,5 @@
                     joyStickAxes_[iDev][i].name_ += "Neg";
                 joyStickAxes_[iDev][i].paramCommandBuffer_ = &paramCommandBuffer_;
-                joyStickAxes_[iDev][i].groupName_ = std::string("JoyStick") + deviceNumber + "Axes";
+                joyStickAxes_[iDev][i].groupName_ = "JoyStickAxes_" + deviceName;
             }
         }
@@ -219,19 +215,19 @@
         for (unsigned int i = 0; i < KeyCode::numberOfKeys; i++)
             if (!keys_[i].name_.empty())
-                allButtons_[keys_[i].name_] = keys_ + i;
+                allButtons_[keys_[i].groupName_ + "." + keys_[i].name_] = keys_ + i;
         for (unsigned int i = 0; i < numberOfMouseButtons_; i++)
-            allButtons_[mouseButtons_[i].name_] = mouseButtons_ + i;
+            allButtons_[mouseButtons_[i].groupName_ + "." + mouseButtons_[i].name_] = mouseButtons_ + i;
         for (unsigned int i = 0; i < MouseAxisCode::numberOfAxes * 2; i++)
         {
-            allButtons_[mouseAxes_[i].name_] = mouseAxes_ + i;
+            allButtons_[mouseAxes_[i].groupName_ + "." + mouseAxes_[i].name_] = mouseAxes_ + i;
             allHalfAxes_.push_back(mouseAxes_ + i);
         }
-        for (unsigned int iDev = 0; iDev < numberOfJoySticks_; iDev++)
+        for (unsigned int iDev = 0; iDev < joySticks_.size(); iDev++)
         {
             for (unsigned int i = 0; i < JoyStickButtonCode::numberOfButtons; i++)
-                allButtons_[joyStickButtons_[iDev][i].name_] = &(joyStickButtons_[iDev][i]);
+                allButtons_[joyStickButtons_[iDev][i].groupName_ + "." + joyStickButtons_[iDev][i].name_] = &(joyStickButtons_[iDev][i]);
             for (unsigned int i = 0; i < JoyStickAxisCode::numberOfAxes * 2; i++)
             {
-                allButtons_[joyStickAxes_[iDev][i].name_] = &(joyStickAxes_[iDev][i]);
+                allButtons_[joyStickAxes_[iDev][i].groupName_ + "." + joyStickAxes_[iDev][i].name_] = &(joyStickAxes_[iDev][i]);
                 allHalfAxes_.push_back(&(joyStickAxes_[iDev][i]));
             }
@@ -303,5 +299,5 @@
     void KeyBinder::resetJoyStickAxes()
     {
-        for (unsigned int iDev = 0; iDev < numberOfJoySticks_; ++iDev)
+        for (unsigned int iDev = 0; iDev < joySticks_.size(); ++iDev)
         {
             for (unsigned int i = 0; i < JoyStickAxisCode::numberOfAxes * 2; i++)
Index: code/branches/core4/src/core/input/KeyBinder.h
===================================================================
--- code/branches/core4/src/core/input/KeyBinder.h	(revision 3305)
+++ code/branches/core4/src/core/input/KeyBinder.h	(revision 3306)
@@ -97,5 +97,5 @@
     protected: // variables
         //! Currently active joy sticks
-        unsigned int numberOfJoySticks_;
+        std::vector<JoyStick*>  joySticks_;
 
         //! Actual key bindings for keys on the keyboard
Index: code/branches/core4/src/core/input/KeyDetector.cc
===================================================================
--- code/branches/core4/src/core/input/KeyDetector.cc	(revision 3305)
+++ code/branches/core4/src/core/input/KeyDetector.cc	(revision 3306)
@@ -26,10 +26,4 @@
  *
  */
-
-/**
-@file
-@brief
-    Implementation of the different input handlers.
-*/
 
 #include "KeyDetector.h"
@@ -68,5 +62,5 @@
         for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
         {
-            it->second->bindingString_ = callbackCommand_ + it->second->name_;
+            it->second->bindingString_ = callbackCommand_ + it->second->groupName_ + "." + it->second->name_;
             it->second->parse();
         }
Index: code/branches/core4/src/core/input/KeyDetector.h
===================================================================
--- code/branches/core4/src/core/input/KeyDetector.h	(revision 3305)
+++ code/branches/core4/src/core/input/KeyDetector.h	(revision 3306)
@@ -27,10 +27,4 @@
  */
 
-/**
-@file
-@brief
-    Different definitions of input processing.
-*/
-
 #ifndef _KeyDetector_H__
 #define _KeyDetector_H__
