Index: code/branches/presentation/bin/def_keybindings.ini
===================================================================
--- code/branches/presentation/bin/def_keybindings.ini	(revision 2542)
+++ code/branches/presentation/bin/def_keybindings.ini	(revision 2543)
@@ -145,97 +145,4 @@
 KeyYen=
 KeyZ=
-Key_084=
-Key_085=
-Key_089=
-Key_090=
-Key_091=
-Key_092=
-Key_093=
-Key_094=
-Key_095=
-Key_096=
-Key_097=
-Key_098=
-Key_099=
-Key_103=
-Key_104=
-Key_105=
-Key_106=
-Key_107=
-Key_108=
-Key_109=
-Key_110=
-Key_111=
-Key_112=
-Key_114=
-Key_115=
-Key_117=
-Key_118=
-Key_119=
-Key_120=
-Key_121=
-Key_123=
-Key_125=
-Key_128=
-Key_129=
-Key_130=
-Key_131=
-Key_132=
-Key_133=
-Key_134=
-Key_135=
-Key_136=
-Key_137=
-Key_138=
-Key_139=
-Key_140=
-Key_141=
-Key_143=
-Key_144=
-Key_154=
-Key_155=
-Key_158=
-Key_159=
-Key_163=
-Key_165=
-Key_166=
-Key_167=
-Key_168=
-Key_169=
-Key_170=
-Key_171=
-Key_172=
-Key_173=
-Key_175=
-Key_177=
-Key_180=
-Key_182=
-Key_185=
-Key_186=
-Key_187=
-Key_188=
-Key_189=
-Key_190=
-Key_191=
-Key_192=
-Key_193=
-Key_194=
-Key_195=
-Key_196=
-Key_198=
-Key_202=
-Key_204=
-Key_206=
-Key_212=
-Key_213=
-Key_214=
-Key_215=
-Key_216=
-Key_217=
-Key_218=
-Key_224=
-Key_225=
-Key_226=
-Key_228=
 
 [MouseButtons]
@@ -256,5 +163,5 @@
 MouseXNeg="scale -1 rotateYaw"
 MouseXPos="scale 1 rotateYaw"
-MouseYNeg="scale 1 rotatePitch"
-MouseYPos="scale -1 rotatePitch"
+MouseYNeg="scale -1 rotatePitch"
+MouseYPos="scale 1 rotatePitch"
 
Index: code/branches/presentation/src/core/ConfigFileManager.cc
===================================================================
--- code/branches/presentation/src/core/ConfigFileManager.cc	(revision 2542)
+++ code/branches/presentation/src/core/ConfigFileManager.cc	(revision 2543)
@@ -160,5 +160,8 @@
                 if ((*it)->getIndex() > size)
                     size = (*it)->getIndex();
-        return (size + 1);
+        if (size == 0)
+            return 0;
+        else
+            return (size + 1);
     }
 
Index: code/branches/presentation/src/core/ConfigValueContainer.cc
===================================================================
--- code/branches/presentation/src/core/ConfigValueContainer.cc	(revision 2542)
+++ code/branches/presentation/src/core/ConfigValueContainer.cc	(revision 2543)
@@ -273,5 +273,6 @@
         {
             this->valueVector_.clear();
-            for (unsigned int i = 0; i < ConfigFileManager::getInstance().getVectorSize(this->type_, this->sectionname_, this->varname_); i++)
+            unsigned int vectorSize = ConfigFileManager::getInstance().getVectorSize(this->type_, this->sectionname_, this->varname_);
+            for (unsigned int i = 0; i < vectorSize; i++)
             {
                 if (i < this->defvalueStringVector_.size())
Index: code/branches/presentation/src/core/ConfigValueContainer.h
===================================================================
--- code/branches/presentation/src/core/ConfigValueContainer.h	(revision 2542)
+++ code/branches/presentation/src/core/ConfigValueContainer.h	(revision 2543)
@@ -109,5 +109,5 @@
             {
                 this->init(type, identifier, sectionname, varname);
-                this->initValue((V)defvalue);
+                this->initValue(static_cast<V>(defvalue));
             }
 
@@ -217,4 +217,7 @@
             inline const std::string& getName() const
                 { return this->varname_; }
+            /** @brief Retuns the name of the section this config value is in. */
+            inline const std::string& getSectionName() const
+                { return this->sectionname_; }
             /** @brief Returns true if this config-value is a vector */
             inline bool isVector() const
Index: code/branches/presentation/src/core/input/Button.cc
===================================================================
--- code/branches/presentation/src/core/input/Button.cc	(revision 2542)
+++ code/branches/presentation/src/core/input/Button.cc	(revision 2543)
@@ -63,4 +63,12 @@
     }
 
+    Button::~Button()
+    {
+        this->clear();
+
+        if (this->configContainer_)
+            delete this->configContainer_;
+    }
+
     void Button::clear()
     {
@@ -81,8 +89,4 @@
             }
         }
-
-        if (this->configContainer_)
-            delete this->configContainer_;
-        this->configContainer_ = 0;
     }
 
Index: code/branches/presentation/src/core/input/Button.h
===================================================================
--- code/branches/presentation/src/core/input/Button.h	(revision 2542)
+++ code/branches/presentation/src/core/input/Button.h	(revision 2543)
@@ -49,5 +49,5 @@
     public:
         Button();
-        virtual ~Button() { clear(); }
+        virtual ~Button();
         virtual void clear();
         virtual bool addParamCommand(ParamCommand* command) { return false; }
Index: code/branches/presentation/src/core/input/InputInterfaces.h
===================================================================
--- code/branches/presentation/src/core/input/InputInterfaces.h	(revision 2542)
+++ code/branches/presentation/src/core/input/InputInterfaces.h	(revision 2543)
@@ -378,7 +378,7 @@
         const char* const ByString[] =
         {
-            "Button0",       "Button1",       "Button2",       "Button3",
-            "Button4",       "Button5",       "Button6",       "Button7",
-            "Button8",       "Button9",       "Button10",      "Button11",
+            "Button00",      "Button01",      "Button02",      "Button03",
+            "Button04",      "Button05",      "Button06",      "Button07",
+            "Button08",      "Button09",      "Button10",      "Button11",
             "Button12",      "Button13",      "Button14",      "Button15",
             "Button16",      "Button17",      "Button18",      "Button19",
@@ -416,7 +416,7 @@
             "Slider0", "Slider1", "Slider2", "Slider3",
             "Slider4", "Slider5", "Slider6", "Slider7",
-            "Axis0",   "Axis1",   "Axis2",   "Axis3",
-            "Axis4",   "Axis5",   "Axis6",   "Axis7",
-            "Axis8",   "Axis9",   "Axis10",  "Axis11",
+            "Axis00",  "Axis01",  "Axis02",  "Axis03",
+            "Axis04",  "Axis05",  "Axis06",  "Axis07",
+            "Axis08",  "Axis09",  "Axis10",  "Axis11",
             "Axis12",  "Axis13",  "Axis14",  "Axis15"
         };
Index: code/branches/presentation/src/core/input/InputManager.cc
===================================================================
--- code/branches/presentation/src/core/input/InputManager.cc	(revision 2542)
+++ code/branches/presentation/src/core/input/InputManager.cc	(revision 2543)
@@ -65,5 +65,4 @@
     SetCommandLineSwitch(keyboard_no_grab);
 
-    std::string InputManager::bindingCommmandString_s = "";
     EmptyHandler InputManager::EMPTY_HANDLER;
     InputManager* InputManager::singletonRef_s = 0;
@@ -174,5 +173,5 @@
             if (joyStickSupport)
                 _initialiseJoySticks();
-            // Do this anyway to also inform everyone if a joystick was detached.
+            // Do this anyway to also inform everything when a joystick was detached.
             _configureNumberOfJoySticks();
 
@@ -492,5 +491,6 @@
             }
         }
-	singletonRef_s = 0;
+
+        singletonRef_s = 0;
     }
 
@@ -660,5 +660,5 @@
     /**
     @brief
-        Updates the InputManager. Tick is called by the Core class.
+        Updates the states and the InputState situation.
     @param dt
         Delta time
@@ -676,36 +676,45 @@
 
         // check for states to leave
-        for (std::set<InputState*>::reverse_iterator rit = stateLeaveRequests_.rbegin();
-            rit != stateLeaveRequests_.rend(); ++rit)
-        {
-            (*rit)->onLeave();
-            // just to be sure that the state actually is registered
-            assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end());
-
-            activeStates_.erase((*rit)->getPriority());
-            _updateActiveStates();
-        }
-        stateLeaveRequests_.clear();
+        if (!stateLeaveRequests_.empty())
+        {
+            for (std::set<InputState*>::reverse_iterator rit = stateLeaveRequests_.rbegin();
+                rit != stateLeaveRequests_.rend(); ++rit)
+            {
+                (*rit)->onLeave();
+                // just to be sure that the state actually is registered
+                assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end());
+
+                activeStates_.erase((*rit)->getPriority());
+                _updateActiveStates();
+            }
+            stateLeaveRequests_.clear();
+        }
 
         // check for states to enter
-        for (std::set<InputState*>::reverse_iterator rit = stateEnterRequests_.rbegin();
-            rit != stateEnterRequests_.rend(); ++rit)
-        {
-            // just to be sure that the state actually is registered
-            assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end());
-
-            activeStates_[(*rit)->getPriority()] = (*rit);
-            _updateActiveStates();
-            (*rit)->onEnter();
-        }
-        stateEnterRequests_.clear();
+        if (!stateEnterRequests_.empty())
+        {
+            for (std::set<InputState*>::reverse_iterator rit = stateEnterRequests_.rbegin();
+                rit != stateEnterRequests_.rend(); ++rit)
+            {
+                // just to be sure that the state actually is registered
+                assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end());
+
+                activeStates_[(*rit)->getPriority()] = (*rit);
+                _updateActiveStates();
+                (*rit)->onEnter();
+            }
+            stateEnterRequests_.clear();
+        }
 
         // check for states to destroy
-        for (std::set<InputState*>::reverse_iterator rit = stateDestroyRequests_.rbegin();
-            rit != stateDestroyRequests_.rend(); ++rit)
-        {
-            _destroyState((*rit));
-        }
-        stateDestroyRequests_.clear();
+        if (!stateDestroyRequests_.empty())
+        {
+            for (std::set<InputState*>::reverse_iterator rit = stateDestroyRequests_.rbegin();
+                rit != stateDestroyRequests_.rend(); ++rit)
+            {
+                _destroyState((*rit));
+            }
+            stateDestroyRequests_.clear();
+        }
 
         // check whether a state has changed its EMPTY_HANDLER situation
@@ -1124,5 +1133,5 @@
 
         // keep in mind that the first 8 axes are reserved for the sliders
-        _fireAxis(iJoyStick, axis + 8, arg.state.mAxes[axis].abs);
+        _fireAxis(iJoyStick, axis + sliderAxes, arg.state.mAxes[axis].abs);
 
         return true;
Index: code/branches/presentation/src/core/input/InputManager.h
===================================================================
--- code/branches/presentation/src/core/input/InputManager.h	(revision 2542)
+++ code/branches/presentation/src/core/input/InputManager.h	(revision 2543)
@@ -136,4 +136,5 @@
     public: // variables
         static EmptyHandler                 EMPTY_HANDLER;
+        static const unsigned int           sliderAxes = 8;
 
     private: // functions
@@ -192,5 +193,5 @@
         SimpleInputState*                   stateEmpty_;
         ExtendedInputState*                 stateMaster_;          //!< Always active master input state
-        KeyDetector*                        keyDetector_;        //!< KeyDetector instance
+        KeyDetector*                        keyDetector_;          //!< KeyDetector instance
         InputBuffer*                        calibratorCallbackBuffer_;
 
@@ -223,5 +224,5 @@
         std::vector<std::vector<JoyStickButtonCode::ByEnum> >  joyStickButtonsDown_;
 
-        static std::string                  bindingCommmandString_s;
+
         static InputManager*                singletonRef_s;
     };
Index: code/branches/presentation/src/core/input/KeyBinder.cc
===================================================================
--- code/branches/presentation/src/core/input/KeyBinder.cc	(revision 2542)
+++ code/branches/presentation/src/core/input/KeyBinder.cc	(revision 2543)
@@ -33,6 +33,8 @@
 
 #include "KeyBinder.h"
+
 #include <fstream>
 #include <string>
+
 #include "util/Convert.h"
 #include "util/Debug.h"
@@ -66,16 +68,7 @@
             std::string keyname = KeyCode::ByString[i];
             if (!keyname.empty())
-            {
                 keys_[i].name_ = std::string("Key") + keyname;
-            }
             else
-            {
-                // some keys have name "" because the code is not occupied by OIS
-                // Use "Key_" plus the number as name to put it at the end of the config file section
-                std::string number = convertToString(i);
-                if (i < 100)
-                    number.insert(0, "0");
-                keys_[i].name_ = std::string("Key_") + number;
-            }
+                keys_[i].name_ = "";
             keys_[i].paramCommandBuffer_ = &paramCommandBuffer_;
             keys_[i].groupName_ = "Keys";
@@ -97,5 +90,5 @@
         for (unsigned int i = 0; i < MouseAxisCode::numberOfAxes * 2; i++)
         {
-            mouseAxes_[i].name_ = std::string("Mouse") + MouseAxisCode::ByString[i >> 1];
+            mouseAxes_[i].name_ = std::string("Mouse") + MouseAxisCode::ByString[i / 2];
             if (i & 1)
                 mouseAxes_[i].name_ += "Pos";
@@ -224,6 +217,8 @@
         allHalfAxes_.clear();
 
+        // Note: Don't include the dummy keys which don't actually exist in OIS but have a number
         for (unsigned int i = 0; i < KeyCode::numberOfKeys; i++)
-            allButtons_[keys_[i].name_] = keys_ + i;
+            if (!keys_[i].name_.empty())
+                allButtons_[keys_[i].name_] = keys_ + i;
         for (unsigned int i = 0; i < numberOfMouseButtons_; i++)
             allButtons_[mouseButtons_[i].name_] = mouseButtons_ + i;
@@ -327,20 +322,20 @@
         if (bDeriveMouseInput_)
         {
-            // only update when derive dt has passed
+            // only update when derivation dt has passed
             if (deriveTime_ > derivePeriod_)
             {
                 for (int i = 0; i < 2; i++)
                 {
-                    if (mouseRelative_[i] > 0)
+                    if (mouseRelative_[i] < 0)
                     {
                         mouseAxes_[2*i + 0].absVal_
-                            =  mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
+                            = -mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
                         mouseAxes_[2*i + 1].absVal_ = 0.0f;
                     }
-                    else if (mouseRelative_[i] < 0)
+                    else if (mouseRelative_[i] > 0)
                     {
                         mouseAxes_[2*i + 0].absVal_ = 0.0f;
                         mouseAxes_[2*i + 1].absVal_
-                            = -mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
+                            =  mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
                     }
                     else
@@ -363,5 +358,5 @@
             // Why dividing relative value by dt? The reason lies in the simple fact, that when you
             // press a button that has relative movement, that value has to be multiplied by dt to be
-            // frame rate independant. This can easily (and only) be done in tickInput(float).
+            // frame rate independent. This can easily (and only) be done in tickInput(float).
             // Hence we need to divide by dt here for the mouse to compensate, because the relative
             // move movements have nothing to do with dt.
@@ -441,5 +436,5 @@
             for (int i = 0; i < 2; i++)
             {
-                if (rel[i]) // performance opt. if rel[i] == 0
+                if (rel[i]) // performance opt. for the case that rel[i] == 0
                 {
                     // write absolute values
@@ -454,7 +449,7 @@
                         mousePosition_[i] = -mouseClippingSize_;
 
-                    if (mousePosition_[i] >= 0)
+                    if (mousePosition_[i] < 0)
                     {
-                        mouseAxes_[2*i + 0].absVal_ =   mousePosition_[i]/(float)mouseClippingSize_ * mouseSensitivity_;
+                        mouseAxes_[2*i + 0].absVal_ =  -mousePosition_[i]/(float)mouseClippingSize_ * mouseSensitivity_;
                         mouseAxes_[2*i + 1].absVal_ =  0.0f;
                     }
@@ -462,5 +457,5 @@
                     {
                         mouseAxes_[2*i + 0].absVal_ =  0.0f;
-                        mouseAxes_[2*i + 1].absVal_ =  -mousePosition_[i]/(float)mouseClippingSize_ * mouseSensitivity_;
+                        mouseAxes_[2*i + 1].absVal_ =   mousePosition_[i]/(float)mouseClippingSize_ * mouseSensitivity_;
                     }
                 }
@@ -471,8 +466,8 @@
         for (int i = 0; i < 2; i++)
         {
-            if (rel[i] > 0)
-                mouseAxes_[0 + 2*i].relVal_ =  ((float)rel[i])/(float)mouseClippingSize_ * mouseSensitivity_;
+            if (rel[i] < 0)
+                mouseAxes_[0 + 2*i].relVal_ = -((float)rel[i])/(float)mouseClippingSize_ * mouseSensitivity_;
             else
-                mouseAxes_[1 + 2*i].relVal_ = -((float)rel[i])/(float)mouseClippingSize_ * mouseSensitivity_;
+                mouseAxes_[1 + 2*i].relVal_ =  ((float)rel[i])/(float)mouseClippingSize_ * mouseSensitivity_;
         }
     }
@@ -484,9 +479,9 @@
     void KeyBinder::mouseScrolled(int abs, int rel)
     {
-        if (rel > 0)
-            for (int i = 0; i < rel/mouseWheelStepSize_; i++)
+        if (rel < 0)
+            for (int i = 0; i < -rel/mouseWheelStepSize_; i++)
                 mouseButtons_[8].execute(KeybindMode::OnPress, ((float)abs)/mouseWheelStepSize_);
         else
-            for (int i = 0; i < -rel/mouseWheelStepSize_; i++)
+            for (int i = 0; i < rel/mouseWheelStepSize_; i++)
                 mouseButtons_[9].execute(KeybindMode::OnPress, ((float)abs)/mouseWheelStepSize_);
     }
@@ -495,8 +490,8 @@
     {
         int i = axis * 2;
-        if (value >= 0)
-        {
-            joyStickAxes_[joyStickID][i].absVal_ = value;
-            joyStickAxes_[joyStickID][i].relVal_ = value;
+        if (value < 0)
+        {
+            joyStickAxes_[joyStickID][i].absVal_ = -value;
+            joyStickAxes_[joyStickID][i].relVal_ = -value;
             joyStickAxes_[joyStickID][i].hasChanged_ = true;
             if (joyStickAxes_[joyStickID][i + 1].absVal_ > 0.0f)
@@ -509,6 +504,6 @@
         else
         {
-            joyStickAxes_[joyStickID][i + 1].absVal_ = -value;
-            joyStickAxes_[joyStickID][i + 1].relVal_ = -value;
+            joyStickAxes_[joyStickID][i + 1].absVal_ = value;
+            joyStickAxes_[joyStickID][i + 1].relVal_ = value;
             joyStickAxes_[joyStickID][i + 1].hasChanged_ = true;
             if (joyStickAxes_[joyStickID][i].absVal_ > 0.0f)
Index: code/branches/presentation/src/core/input/KeyBinder.h
===================================================================
--- code/branches/presentation/src/core/input/KeyBinder.h	(revision 2542)
+++ code/branches/presentation/src/core/input/KeyBinder.h	(revision 2543)
@@ -39,4 +39,6 @@
 
 #include <vector>
+#include <cassert>
+
 #include "InputInterfaces.h"
 #include "Button.h"
@@ -44,5 +46,4 @@
 #include "InputCommands.h"
 #include "JoyStickDeviceNumberListener.h"
-#include "core/ConfigFileManager.h"
 
 namespace orxonox
@@ -171,11 +172,11 @@
 
     inline void KeyBinder::keyPressed (const KeyEvent& evt)
-    { keys_[evt.key].execute(KeybindMode::OnPress); }
+    { assert(!keys_[evt.key].name_.empty()); keys_[evt.key].execute(KeybindMode::OnPress); }
 
     inline void KeyBinder::keyReleased(const KeyEvent& evt)
-    { keys_[evt.key].execute(KeybindMode::OnRelease); }
+    { assert(!keys_[evt.key].name_.empty()); keys_[evt.key].execute(KeybindMode::OnRelease); }
 
     inline void KeyBinder::keyHeld    (const KeyEvent& evt)
-    { keys_[evt.key].execute(KeybindMode::OnHold); }
+    { assert(!keys_[evt.key].name_.empty()); keys_[evt.key].execute(KeybindMode::OnHold); }
 
 
Index: code/branches/presentation/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/presentation/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	(revision 2542)
+++ code/branches/presentation/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	(revision 2543)
@@ -160,5 +160,5 @@
     void SpaceShip::rotateYaw(const Vector2& value)
     {
-        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() + value.x);
+        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
 
         Pawn::rotateYaw(value);
Index: code/branches/presentation/src/orxonox/objects/worldentities/pawns/Spectator.cc
===================================================================
--- code/branches/presentation/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2542)
+++ code/branches/presentation/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2543)
@@ -177,5 +177,5 @@
     void Spectator::rotateYaw(const Vector2& value)
     {
-        this->yaw_ += value.y;
+        this->yaw_ -= value.y;
 
         ControllableEntity::rotateYaw(value);
Index: code/branches/presentation/visual_studio/vc8/util.vcproj
===================================================================
--- code/branches/presentation/visual_studio/vc8/util.vcproj	(revision 2542)
+++ code/branches/presentation/visual_studio/vc8/util.vcproj	(revision 2543)
@@ -173,8 +173,4 @@
 			</File>
 			<File
-				RelativePath="..\..\src\util\OrxEnum.cc"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\util\OutputBuffer.cc"
 				>
