Index: /code/trunk/bin/keybindings.ini
===================================================================
--- /code/trunk/bin/keybindings.ini	(revision 1348)
+++ /code/trunk/bin/keybindings.ini	(revision 1349)
@@ -1,560 +1,264 @@
 [KeyBinder]
-P_UNASSIGNED=activateConsole
-R_UNASSIGNED=
-H_UNASSIGNED=
-P_ESCAPE="exit"
-R_ESCAPE=
-H_ESCAPE=
-P_1=
-R_1=
-H_1=
-P_2=
-R_2=
-H_2=
-P_3=
-R_3=
-H_3=
-P_4=
-R_4=
-H_4=
-P_5=
-R_5=
-H_5=
-P_6=
-R_6=
-H_6=
-P_7="exec disco.txt"
-R_7=
-H_7=
-P_8=
-R_8=
-H_8=
-P_9="disco.txt"
-R_9=
-H_9=
-P_0=
-R_0=
-H_0=
-P_MINUS=
-R_MINUS=
-H_MINUS=
-P_EQUALS=activateConsole
-R_EQUALS=
-H_EQUALS=
-P_BACK=
-R_BACK=
-H_BACK=
-P_TAB=
-R_TAB=
-H_TAB=
-P_Q=
-R_Q=
-H_Q=
-P_W=
-R_W=
-H_W=
-P_E=
-R_E=
-H_E=
-P_R=
-R_R=
-H_R=
-P_T=
-R_T=
-H_T=
-P_Y=
-R_Y=
-H_Y=
-P_U=
-R_U=
-H_U=
-P_I=
-R_I=
-H_I=
-P_O=
-R_O=
-H_O=
-P_P=
-R_P=
-H_P=
-P_LBRACKET=
-R_LBRACKET=
-H_LBRACKET=
-P_RBRACKET=
-R_RBRACKET=
-H_RBRACKET=
-P_RETURN=
-R_RETURN=
-H_RETURN=
-P_LCONTROL=
-R_LCONTROL=
-H_LCONTROL=
-P_A=
-R_A=
-H_A=
-P_S=
-R_S=
-H_S=
-P_D=
-R_D=
-H_D=
-P_F=
-R_F=
-H_F=
-P_G=
-R_G=
-H_G=
-P_H=
-R_H=
-H_H=
-P_J=
-R_J=
-H_J=
-P_K=
-R_K=
-H_K=
-P_L=
-R_L=
-H_L=
-P_SEMICOLON=
-R_SEMICOLON=
-H_SEMICOLON=
-P_APOSTROPHE=
-R_APOSTROPHE=
-H_APOSTROPHE=
-P_GRAVE=activateConsole
-R_GRAVE=
-H_GRAVE=
-P_LSHIFT=
-R_LSHIFT=
-H_LSHIFT=
-P_BACKSLASH=
-R_BACKSLASH=
-H_BACKSLASH=
-P_Z=
-R_Z=
-H_Z=
-P_X=
-R_X=
-H_X=
-P_C=
-R_C=
-H_C=
-P_V=
-R_V=
-H_V=
-P_B=
-R_B=
-H_B=
-P_N=
-R_N=
-H_N=
-P_M=
-R_M=
-H_M=
-P_COMMA=
-R_COMMA=
-H_COMMA=
-P_PERIOD=
-R_PERIOD=
-H_PERIOD=
-P_SLASH=
-R_SLASH=
-H_SLASH=
-P_RSHIFT=
-R_RSHIFT=
-H_RSHIFT=
-P_MULTIPLY=
-R_MULTIPLY=
-H_MULTIPLY=
-P_LMENU=
-R_LMENU=
-H_LMENU=
-P_SPACE=
-R_SPACE=
-H_SPACE=
-P_CAPITAL=
-R_CAPITAL=
-H_CAPITAL=
-P_F1=
-R_F1=
-H_F1=
-P_F2=
-R_F2=
-H_F2=
-P_F3=
-R_F3=
-H_F3=
-P_F4=
-R_F4=
-H_F4=
-P_F5=
-R_F5=
-H_F5=
-P_F6=
-R_F6=
-H_F6=
-P_F7=
-R_F7=
-H_F7=
-P_F8=
-R_F8=
-H_F8=
-P_F9=
-R_F9=
-H_F9=
-P_F10=
-R_F10=
-H_F10=
-P_NUMLOCK=
-R_NUMLOCK=
-H_NUMLOCK=
-P_SCROLL=
-R_SCROLL=
-H_SCROLL=
-P_NUMPAD7=
-R_NUMPAD7=
-H_NUMPAD7=
-P_NUMPAD8=
-R_NUMPAD8=
-H_NUMPAD8=
-P_NUMPAD9=
-R_NUMPAD9=
-H_NUMPAD9=
-P_SUBTRACT=
-R_SUBTRACT=
-H_SUBTRACT=
-P_NUMPAD4=
-R_NUMPAD4=
-H_NUMPAD4=
-P_NUMPAD5=
-R_NUMPAD5=
-H_NUMPAD5=
-P_NUMPAD6=
-R_NUMPAD6=
-H_NUMPAD6=
-P_ADD=
-R_ADD=
-H_ADD=
-P_NUMPAD1=
-R_NUMPAD1=
-H_NUMPAD1=
-P_NUMPAD2=
-R_NUMPAD2=
-H_NUMPAD2=
-P_NUMPAD3=
-R_NUMPAD3=
-H_NUMPAD3=
-P_NUMPAD0=
-R_NUMPAD0=
-H_NUMPAD0=
-P_DECIMAL=
-R_DECIMAL=
-H_DECIMAL=
-P_=
-R_=
-H_=
-P_OEM_102=
-R_OEM_102=
-H_OEM_102=
-P_F11=
-R_F11=
-H_F11=
-P_F12=
-R_F12=
-H_F12=
-P_F13=
-R_F13=
-H_F13=
-P_F14=
-R_F14=
-H_F14=
-P_F15=
-R_F15=
-H_F15=
-P_KANA=
-R_KANA=
-H_KANA=
-P_ABNT_C1=
-R_ABNT_C1=
-H_ABNT_C1=
-P_CONVERT=
-R_CONVERT=
-H_CONVERT=
-P_NOCONVERT=
-R_NOCONVERT=
-H_NOCONVERT=
-P_YEN=
-R_YEN=
-H_YEN=
-P_ABNT_C2=
-R_ABNT_C2=
-H_ABNT_C2=
-P_NUMPADEQUALS=
-R_NUMPADEQUALS=
-H_NUMPADEQUALS=
-P_PREVTRACK=
-R_PREVTRACK=
-H_PREVTRACK=
-P_AT=
-R_AT=
-H_AT=
-P_COLON=
-R_COLON=
-H_COLON=
-P_UNDERLINE=
-R_UNDERLINE=
-H_UNDERLINE=
-P_KANJI=
-R_KANJI=
-H_KANJI=
-P_STOP=
-R_STOP=
-H_STOP=
-P_AX=
-R_AX=
-H_AX=
-P_UNLABELED=
-R_UNLABELED=
-H_UNLABELED=
-P_NEXTTRACK=
-R_NEXTTRACK=
-H_NEXTTRACK=
-P_NUMPADENTER=activateConsole
-R_NUMPADENTER=
-H_NUMPADENTER=
-P_RCONTROL=
-R_RCONTROL=
-H_RCONTROL=
-P_MUTE=
-R_MUTE=
-H_MUTE=
-P_CALCULATOR=
-R_CALCULATOR=
-H_CALCULATOR=
-P_PLAYPAUSE=
-R_PLAYPAUSE=
-H_PLAYPAUSE=
-P_MEDIASTOP=exit
-R_MEDIASTOP=
-H_MEDIASTOP=
-P_VOLUMEDOWN=
-R_VOLUMEDOWN=
-H_VOLUMEDOWN=
-P_VOLUMEUP=
-R_VOLUMEUP=
-H_VOLUMEUP=
-P_WEBHOME=
-R_WEBHOME=
-H_WEBHOME=
-P_NUMPADCOMMA=
-R_NUMPADCOMMA=
-H_NUMPADCOMMA=
-P_DIVIDE=
-R_DIVIDE=
-H_DIVIDE=
-P_SYSRQ=
-R_SYSRQ=
-H_SYSRQ=
-P_RMENU=
-R_RMENU=
-H_RMENU=
-P_PAUSE=
-R_PAUSE=
-H_PAUSE=
-P_HOME=
-R_HOME=
-H_HOME=
-P_UP=
-R_UP=
-H_UP=
-P_PGUP=
-R_PGUP=
-H_PGUP=
-P_LEFT=
-R_LEFT=
-H_LEFT=
-P_RIGHT=
-R_RIGHT=
-H_RIGHT=
-P_END=
-R_END=
-H_END=
-P_DOWN=
-R_DOWN=
-H_DOWN=
-P_PGDOWN=
-R_PGDOWN=
-H_PGDOWN=
-P_INSERT=
-R_INSERT=
-H_INSERT=
-P_DELETE=
-R_DELETE=
-H_DELETE=
-P_LWIN=
-R_LWIN=
-H_LWIN=
-P_RWIN=
-R_RWIN=
-H_RWIN=
-P_APPS=
-R_APPS=
-H_APPS=
-P_POWER=
-R_POWER=
-H_POWER=
-P_SLEEP=
-R_SLEEP=
-H_SLEEP=
-P_WAKE=
-R_WAKE=
-H_WAKE=
-P_WEBSEARCH=
-R_WEBSEARCH=
-H_WEBSEARCH=
-P_WEBFAVORITES=
-R_WEBFAVORITES=
-H_WEBFAVORITES=
-P_WEBREFRESH=
-R_WEBREFRESH=
-H_WEBREFRESH=
-P_WEBSTOP=
-R_WEBSTOP=
-H_WEBSTOP=
-P_WEBFORWARD=
-R_WEBFORWARD=
-H_WEBFORWARD=
-P_WEBBACK=
-R_WEBBACK=
-H_WEBBACK=
-P_MYCOMPUTER=
-R_MYCOMPUTER=
-H_MYCOMPUTER=
-P_MAIL=
-R_MAIL=
-H_MAIL=
-P_MEDIASELECT=
-R_MEDIASELECT=
-H_MEDIASELECT=
-P_MouseLeft=
-R_MouseLeft=
-H_MouseLeft=
-P_MouseRight=
-R_MouseRight=
-H_MouseRight=
-P_MouseMiddle=
-R_MouseMiddle=
-H_MouseMiddle=
-P_MouseButton3=
-R_MouseButton3=
-H_MouseButton3=
-P_MouseButton4=
-R_MouseButton4=
-H_MouseButton4=
-P_MouseButton5=
-R_MouseButton5=
-H_MouseButton5=
-P_MouseButton6=
-R_MouseButton6=
-H_MouseButton6=
-P_MouseButton7=
-R_MouseButton7=
-H_MouseButton7=
-P_JoyStick0=
-R_JoyStick0=
-H_JoyStick0=
-P_JoyStick1=
-R_JoyStick1=
-H_JoyStick1=
-P_JoyStick2=
-R_JoyStick2=
-H_JoyStick2=
-P_JoyStick3=
-R_JoyStick3=
-H_JoyStick3=
-P_JoyStick4=
-R_JoyStick4=
-H_JoyStick4=
-P_JoyStick5=
-R_JoyStick5=
-H_JoyStick5=
-P_JoyStick6=
-R_JoyStick6=
-H_JoyStick6=
-P_JoyStick7=
-R_JoyStick7=
-H_JoyStick7=
-P_JoyStick8=
-R_JoyStick8=
-H_JoyStick8=
-P_JoyStick9=
-R_JoyStick9=
-H_JoyStick9=
-P_JoyStick10=
-R_JoyStick10=
-H_JoyStick10=
-P_JoyStick11=
-R_JoyStick11=
-H_JoyStick11=
-P_JoyStick12=
-R_JoyStick12=
-H_JoyStick12=
-P_JoyStick13=
-R_JoyStick13=
-H_JoyStick13=
-P_JoyStick14=
-R_JoyStick14=
-H_JoyStick14=
-P_JoyStick15=
-R_JoyStick15=
-H_JoyStick15=
-P_JoyStick16=
-R_JoyStick16=
-H_JoyStick16=
-P_JoyStick17=
-R_JoyStick17=
-H_JoyStick17=
-P_JoyStick18=
-R_JoyStick18=
-H_JoyStick18=
-P_JoyStick19=
-R_JoyStick19=
-H_JoyStick19=
-P_JoyStick20=
-R_JoyStick20=
-H_JoyStick20=
-P_JoyStick21=
-R_JoyStick21=
-H_JoyStick21=
-P_JoyStick22=
-R_JoyStick22=
-H_JoyStick22=
-P_JoyStick23=
-R_JoyStick23=
-H_JoyStick23=
-P_JoyStick24=
-R_JoyStick24=
-H_JoyStick24=
-P_JoyStick25=
-R_JoyStick25=
-H_JoyStick25=
-P_JoyStick26=
-R_JoyStick26=
-H_JoyStick26=
-P_JoyStick27=
-R_JoyStick27=
-H_JoyStick27=
-P_JoyStick28=
-R_JoyStick28=
-H_JoyStick28=
-P_JoyStick29=
-R_JoyStick29=
-H_JoyStick29=
-P_JoyStick30=
-R_JoyStick30=
-H_JoyStick30=
-P_JoyStick31=
-R_JoyStick31=
-H_JoyStick31=
+KeyUNASSIGNED=
+KeyESCAPE=exit
+Key1=
+Key2=
+Key3=
+Key4=
+Key5=
+Key6=
+Key7=
+Key8=
+Key9=
+Key0=
+KeyMINUS=
+KeyEQUALS=activateConsole
+KeyBACK=
+KeyTAB=
+KeyQ=
+KeyW=
+KeyE=
+KeyR=
+KeyT=
+KeyY=
+KeyU=
+KeyI=
+KeyO=
+KeyP=
+KeyLBRACKET=
+KeyRBRACKET=
+KeyRETURN=
+KeyLCONTROL=
+KeyA=
+KeyS=
+KeyD=
+KeyF=
+KeyG=
+KeyH=
+KeyJ=
+KeyK=
+KeyL=
+KeySEMICOLON=
+KeyAPOSTROPHE=
+KeyGRAVE=activateConsole
+KeyLSHIFT=
+KeyBACKSLASH=
+KeyZ=
+KeyX=
+KeyC=
+KeyV=
+KeyB=
+KeyN=
+KeyM=
+KeyCOMMA=
+KeyPERIOD=
+KeySLASH=
+KeyRSHIFT=
+KeyMULTIPLY=
+KeyLMENU=
+KeySPACE=
+KeyCAPITAL=
+KeyF1=
+KeyF2=
+KeyF3=
+KeyF4=
+KeyF5=
+KeyF6=
+KeyF7=
+KeyF8=
+KeyF9=
+KeyF10=
+KeyNUMLOCK=
+KeySCROLL=
+KeyNUMPAD7=
+KeyNUMPAD8=
+KeyNUMPAD9=
+KeySUBTRACT=
+KeyNUMPAD4=
+KeyNUMPAD5=
+KeyNUMPAD6=
+KeyADD=
+KeyNUMPAD1=
+KeyNUMPAD2=
+KeyNUMPAD3=
+KeyNUMPAD0=
+KeyDECIMAL=
+Key=
+KeyOEM_102=
+KeyF11=
+KeyF12=
+KeyF13=
+KeyF14=
+KeyF15=
+KeyKANA=
+KeyABNT_C1=
+KeyCONVERT=
+KeyNOCONVERT=
+KeyYEN=
+KeyABNT_C2=
+KeyNUMPADEQUALS=
+KeyPREVTRACK=
+KeyAT=
+KeyCOLON=
+KeyUNDERLINE=
+KeyKANJI=
+KeySTOP=
+KeyAX=
+KeyUNLABELED=
+KeyNEXTTRACK=
+KeyNUMPADENTER=activateConsole
+KeyRCONTROL=
+KeyMUTE=
+KeyCALCULATOR=
+KeyPLAYPAUSE=
+KeyMEDIASTOP=
+KeyVOLUMEDOWN=
+KeyVOLUMEUP=
+KeyWEBHOME=
+KeyNUMPADCOMMA=
+KeyDIVIDE=
+KeySYSRQ=
+KeyRMENU=
+KeyPAUSE=
+KeyHOME=
+KeyUP=
+KeyPGUP=
+KeyLEFT=
+KeyRIGHT=
+KeyEND=
+KeyDOWN=
+KeyPGDOWN=
+KeyINSERT=
+KeyDELETE=
+KeyLWIN=
+KeyRWIN=
+KeyAPPS=
+KeyPOWER=
+KeySLEEP=
+KeyWAKE=
+KeyWEBSEARCH=
+KeyWEBFAVORITES=
+KeyWEBREFRESH=
+KeyWEBSTOP=exit
+KeyWEBFORWARD=
+KeyWEBBACK=
+KeyMYCOMPUTER=
+KeyMAIL=
+KeyMEDIASELECT=
+MouseLeft=
+MouseRight=
+MouseMiddle=
+MouseButton3=
+MouseButton4=
+MouseButton5=
+MouseButton6=
+MouseButton7=
+MouseWheel1Up=#AxisAmp 0.1 slomo
+MouseWheel1Down=#AxisAmp 0.1 slomo
+MouseWheel2Up=
+MouseWheel2Down=
+MouseXPos= #exit | ButtonThreshold 0.85
+MouseXNeg=
+MouseYPos=
+MouseYNeg=
+Empty1Pos=
+Empty1Neg=
+Empty2Pos=
+Empty2Neg=
+JoyAxis1Pos=
+JoyAxis1Neg=
+JoyAxis2Pos=
+JoyAxis2Neg=
+JoyAxis3Pos=
+JoyAxis3Neg=
+JoyAxis4Pos=
+JoyAxis4Neg=
+JoyAxis5Pos=
+JoyAxis5Neg=#AxisAmp 10 slomo | ButtonThreshold 0.9 | onPress exit
+JoyAxis6Pos=#AxisAmp  10 slomo
+JoyAxis6Neg=
+JoyAxis7Pos=
+JoyAxis7Neg=
+JoyAxis8Pos=
+JoyAxis8Neg=
+JoyAxis9Pos=
+JoyAxis9Neg=
+JoyAxis10Pos=
+JoyAxis10Neg=
+JoyAxis11Pos=
+JoyAxis11Neg=
+JoyAxis12Pos=
+JoyAxis12Neg=
+JoyAxis13Pos=
+JoyAxis13Neg=
+JoyAxis14Pos=
+JoyAxis14Neg=
+JoyAxis15Pos=
+JoyAxis15Neg=
+JoyAxis16Pos=
+JoyAxis16Neg=
+JoyAxis17Pos=
+JoyAxis17Neg=
+JoyAxis18Pos=
+JoyAxis18Neg=
+JoyAxis19Pos=
+JoyAxis19Neg=
+JoyAxis20Pos=
+JoyAxis20Neg=
+JoyAxis21Pos=
+JoyAxis21Neg=
+JoyAxis22Pos=
+JoyAxis22Neg=
+JoyAxis23Pos=
+JoyAxis23Neg=
+JoyAxis24Pos=
+JoyAxis24Neg=
+JoyButton0=
+JoyButton1=
+JoyButton2=
+JoyButton3=
+JoyButton4=
+JoyButton5=
+JoyButton6=
+JoyButton7=
+JoyButton8=
+JoyButton9=
+JoyButton10=
+JoyButton11=
+JoyButton12=
+JoyButton13=
+JoyButton14=
+JoyButton15=
+JoyButton16=
+JoyButton17=
+JoyButton18=
+JoyButton19=
+JoyButton20=
+JoyButton21=
+JoyButton22=
+JoyButton23=
+JoyButton24=
+JoyButton25=
+JoyButton26=
+JoyButton27=
+JoyButton28=
+JoyButton29=
+JoyButton30=
+JoyButton31=
+JoyPOV1North=
+JoyPOV1South=
+JoyPOV1East=
+JoyPOV1West=
+JoyPOV2North=
+JoyPOV2South=
+JoyPOV2East=
+JoyPOV2West=
+JoyPOV3North=
+JoyPOV3South=
+JoyPOV3East=
+JoyPOV3West=
+JoyPOV4North=
+JoyPOV4South=
+JoyPOV4East=
+JoyPOV4West=
 
Index: /code/trunk/src/core/CommandExecutor.cc
===================================================================
--- /code/trunk/src/core/CommandExecutor.cc	(revision 1348)
+++ /code/trunk/src/core/CommandExecutor.cc	(revision 1349)
@@ -31,4 +31,5 @@
 #include "util/String.h"
 #include "util/Convert.h"
+#include "util/SubString.h"
 #include "Identifier.h"
 #include "Language.h"
@@ -173,5 +174,5 @@
     }
 
-    KeybindMode CommandEvaluation::getKeybindMode()
+    KeybindMode::Enum CommandEvaluation::getKeybindMode()
     {
         if (this->state_ == CS_Shortcut_Params || this->state_ == CS_Shortcut_Finished)
@@ -198,5 +199,5 @@
         }
         // FIXME: Had to insert a return statement
-        return (KeybindMode)0;
+        return (KeybindMode::Enum)0;
     }
 
Index: /code/trunk/src/core/CommandExecutor.h
===================================================================
--- /code/trunk/src/core/CommandExecutor.h	(revision 1348)
+++ /code/trunk/src/core/CommandExecutor.h	(revision 1349)
@@ -70,6 +70,4 @@
     std::string read(const std::string& filename);
 
-    enum KeybindMode {}; // temporary
-
     ///////////////////////
     // CommandEvaluation //
@@ -82,5 +80,5 @@
             CommandEvaluation();
 
-            KeybindMode getKeybindMode();
+            KeybindMode::Enum getKeybindMode();
             bool isValid() const;
 
@@ -89,5 +87,6 @@
             inline std::string getAdditionalParameter() const
                 { return (this->additionalParameter_ != "") ? (" " + this->additionalParameter_) : ""; }
-            inline std::string getCommandString() const { return this->processedCommand_; }
+            inline ExecutorStatic* getEvaluatedExecutor() { return evaluatedExecutor_; }
+            inline std::string getCommandString() { return this->processedCommand_; }
 
             void setEvaluatedParameter(unsigned int index, MultiTypeMath param);
Index: /code/trunk/src/core/CorePrereqs.h
===================================================================
--- /code/trunk/src/core/CorePrereqs.h	(revision 1348)
+++ /code/trunk/src/core/CorePrereqs.h	(revision 1349)
@@ -78,4 +78,15 @@
 #endif
 
+  namespace KeybindMode
+  {
+    enum Enum
+    {
+      OnPress,
+      OnHold,
+      OnRelease,
+      None
+    };
+  };
+
   typedef std::string LanguageEntryLabel;
 
Index: /code/trunk/src/core/Executor.cc
===================================================================
--- /code/trunk/src/core/Executor.cc	(revision 1348)
+++ /code/trunk/src/core/Executor.cc	(revision 1349)
@@ -39,4 +39,7 @@
         this->name_ = name;
         this->accessLevel_ = level;
+        this->keybindMode_ = KeybindMode::OnPress;
+        this->axisParamIndex_ = -1;
+        this->bAxisRelative_ = false;
 
         this->bAddedDescription_ = false;
Index: /code/trunk/src/core/Executor.h
===================================================================
--- /code/trunk/src/core/Executor.h	(revision 1348)
+++ /code/trunk/src/core/Executor.h	(revision 1349)
@@ -204,4 +204,19 @@
                 { return this->accessLevel_; }
 
+            inline Executor& setKeybindMode(KeybindMode::Enum mode)
+                { this->keybindMode_ = mode; return *this; }
+            inline KeybindMode::Enum getKeybindMode() const
+                { return this->keybindMode_; }
+
+            inline Executor& setAxisParamIndex(int index)
+                { this->axisParamIndex_ = index; return *this; }
+            inline int getAxisParamIndex() const
+                { return this->axisParamIndex_; }
+
+            inline Executor& setIsAxisRelative(bool val)
+                { this->bAxisRelative_ = val; return *this; }
+            inline int getIsAxisRelative() const
+                { return this->bAxisRelative_; }
+
             Executor& setDefaultValues(const MultiTypeMath& param1);
             Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2);
@@ -233,4 +248,8 @@
             MultiTypeMath defaultValue_[MAX_FUNCTOR_ARGUMENTS];
             bool bAddedDefaultValue_[MAX_FUNCTOR_ARGUMENTS];
+
+            KeybindMode::Enum keybindMode_;
+            int axisParamIndex_;
+            bool bAxisRelative_;
 
         private:
Index: /code/trunk/src/core/InputBuffer.cc
===================================================================
--- /code/trunk/src/core/InputBuffer.cc	(revision 1348)
+++ /code/trunk/src/core/InputBuffer.cc	(revision 1349)
@@ -173,4 +173,8 @@
   }
 
+  /**
+  * This tick() function is called by the InputManager if the InputBuffer is active.
+  * @param dt Delta time
+  */
   void InputBuffer::tick(float dt)
   {
@@ -187,5 +191,5 @@
   }
 
-  bool InputBuffer::keyPressed(const KeyEvent &evt)
+  void InputBuffer::keyPressed(const KeyEvent &evt)
   {
     lastKey_ = evt.key;
@@ -195,8 +199,7 @@
 
     processKey(evt);
-    return true;
-  }
-
-  bool InputBuffer::keyHeld(const KeyEvent& evt)
+  }
+
+  void InputBuffer::keyHeld(const KeyEvent& evt)
   {
     if (evt.key == lastKey_)
@@ -208,5 +211,4 @@
       }
     }
-    return true;
   }
 
Index: /code/trunk/src/core/InputBuffer.h
===================================================================
--- /code/trunk/src/core/InputBuffer.h	(revision 1348)
+++ /code/trunk/src/core/InputBuffer.h	(revision 1349)
@@ -43,5 +43,5 @@
   {};
 
-  class _CoreExport InputBuffer : public KeyHandler, public TickableReal
+  class _CoreExport InputBuffer : public KeyHandler, public OrxonoxClass
   {
     struct InputBufferListenerTuple
@@ -101,7 +101,7 @@
     bool charIsAllowed(const char& input);
 
-    bool keyPressed (const KeyEvent& evt);
-    bool keyReleased(const KeyEvent& evt) { return true; }
-    bool keyHeld    (const KeyEvent& evt);
+    void keyPressed (const KeyEvent& evt);
+    void keyReleased(const KeyEvent& evt) { }
+    void keyHeld    (const KeyEvent& evt);
     void processKey (const KeyEvent &e);
 
Index: /code/trunk/src/core/InputHandler.cc
===================================================================
--- /code/trunk/src/core/InputHandler.cc	(revision 1348)
+++ /code/trunk/src/core/InputHandler.cc	(revision 1349)
@@ -34,12 +34,269 @@
 #include "InputHandler.h"
 #include "util/Convert.h"
+#include "util/SubString.h"
+#include "util/String.h"
 #include "Debug.h"
 #include "ConfigValueIncludes.h"
 #include "CoreIncludes.h"
 #include "CommandExecutor.h"
+#include "Executor.h"
 
 namespace orxonox
 {
   // ###############################
+  // ######      Button       ######
+  // ###############################
+
+  bool BufferedParamCommand::execute()
+  {
+    if (nValuesAdded_)
+    {
+      BufferedParamCommand& cmd = *this;
+      cmd.evaluation_.setEvaluatedParameter(cmd.paramIndex_, cmd.value_);
+      // reset
+      cmd.nValuesAdded_ = 0;
+      cmd.value_ = 0;
+      return CommandExecutor::execute(cmd.evaluation_);
+    }
+    else
+      return true;
+  }
+
+  bool SimpleCommand::execute(float abs, float rel)
+  {
+    return CommandExecutor::execute(evaluation_);
+  }
+
+  bool ParamCommand::execute(float abs, float rel)
+  {
+    BufferedParamCommand& paramCommand = *paramCommand_;
+    // command has an additional parameter
+    if (bRelative_ && (rel > 0 || rel < 0))
+    {
+      // we have to calculate a relative movement.
+      // paramModifier_ says how much one keystroke is
+      paramCommand.value_ += paramModifier_ * rel;
+    }
+    else if (abs > 0 || abs < 0)
+    {
+      // we have to calculate absolute position of the axis.
+      // Since there might be another axis that is affected, we have to wait and
+      // store the result in a temporary place
+      paramCommand.value_ = (paramCommand.value_ * paramCommand.nValuesAdded_ + paramModifier_ * abs)
+                            /++paramCommand.nValuesAdded_;
+    }
+    return true;
+  }
+
+  void Button::clear()
+  {
+    for (unsigned int j = 0; j < 3; j++)
+    {
+      if (nCommands_[j])
+      {
+        // delete all commands and the command pointer array
+        for (unsigned int i = 0; i < nCommands_[j]; i++)
+          delete commands_[j][i];
+        delete[] commands_[j];
+        commands_[j] = 0;
+        nCommands_[j] = 0;
+      }
+      else
+      {
+        commands_[j] = 0;
+      }
+    }
+  }
+
+  void Button::parse(std::vector<BufferedParamCommand*>& paramCommandBuffer)
+  {
+    if (isEmpty(bindingString_))
+    {
+      clear();
+      return;
+    }
+
+    // use std::vector for a temporary dynamic array
+    std::vector<BaseCommand*> commands[3];
+
+
+    // separate the commands
+    SubString commandStrings(bindingString_, "|", SubString::WhiteSpaces, false,
+        '\\', false, '"', false, '(', ')', false, '\0');
+
+    for (unsigned int iCommand = 0; iCommand < commandStrings.size(); iCommand++)
+    {
+      if (commandStrings[iCommand] != "")
+      {
+        SubString tokens(commandStrings[iCommand], " ", SubString::WhiteSpaces, false,
+            '\\', false, '"', false, '(', ')', false, '\0');
+        
+        unsigned int iToken = 0;
+
+        // for real axes, we can feed a ButtonThreshold argument as entire command
+        if (getLowercase(tokens[0]) == "buttonthreshold")
+        {
+          if (tokens.size() == 1)
+            continue;
+          // may fail, but doesn't matter
+          convertValue(&buttonThreshold_, tokens[1]);
+          continue;
+        }
+
+        // first argument can be OnPress, OnHold OnRelease or nothing
+        KeybindMode::Enum mode = KeybindMode::None;
+        if (getLowercase(tokens[iToken]) == "onpress")
+          mode = KeybindMode::OnPress,   iToken++;
+        if (getLowercase(tokens[iToken]) == "onrelease")
+          mode = KeybindMode::OnRelease, iToken++;
+        if (getLowercase(tokens[iToken]) == "onhold")
+          mode = KeybindMode::OnHold,    iToken++;
+
+        if (iToken == tokens.size())
+          continue;
+
+        // second argument can be the amplitude for the case it as an axis command
+        // default amplitude is 1.0f
+        float paramModifier = 1.0f;
+        if (getLowercase(tokens[iToken]) == "axisamp")
+        {
+          iToken++;
+          if (iToken == tokens.size() || !convertValue(&paramModifier, tokens[iToken]))
+          {
+            COUT(2) << "Error while parsing key binding " << name_
+                << ". Numeric expression expected afer 'AxisAmp', switching to default value" << std::endl;
+            if (iToken == tokens.size())
+              continue;
+          }
+          iToken++;
+        }
+
+        // no more arguments expected except for the actual command
+        if (iToken == tokens.size())
+          continue;
+
+        std::string commandStr;
+        while (iToken != tokens.size())
+          commandStr += tokens[iToken++] + " ";
+
+        // evaluate the command
+        CommandEvaluation eval = CommandExecutor::evaluate(commandStr);
+        if (!eval.isValid())
+          continue;
+
+        // check for param command
+        int paramIndex = eval.getEvaluatedExecutor()->getAxisParamIndex();
+        // TODO: check in Executor for correct paramIndex
+        if (paramIndex >= 0)
+        {
+          // parameter supported command
+          ParamCommand* cmd = new ParamCommand();
+          cmd->paramModifier_ = paramModifier;
+          cmd->bRelative_ = eval.getEvaluatedExecutor()->getIsAxisRelative();
+
+          // add command to the buffer if not yet existing
+          for (unsigned int iParamCmd = 0; iParamCmd < paramCommandBuffer.size(); iParamCmd++)
+          {
+            if (getLowercase(paramCommandBuffer[iParamCmd]->evaluation_.getCommandString())
+                == getLowercase(commandStr))
+            {
+              // already in list
+              cmd->paramCommand_ = paramCommandBuffer[iParamCmd];
+              break;
+            }
+          }
+          if (cmd->paramCommand_ == 0)
+          {
+            cmd->paramCommand_ = new BufferedParamCommand();
+            paramCommandBuffer.push_back(cmd->paramCommand_);
+            cmd->paramCommand_->evaluation_ = eval;
+            cmd->paramCommand_->paramIndex_ = paramIndex;
+          }
+
+
+          // we don't know whether this is an actual axis or just a button
+          if (mode == KeybindMode::None)
+          {
+            if (!addParamCommand(cmd))
+            {
+              mode = eval.getEvaluatedExecutor()->getKeybindMode();
+              commands[mode].push_back(cmd);
+            }
+          }
+        }
+        else
+        {
+          SimpleCommand* cmd = new SimpleCommand();
+          cmd->evaluation_ = eval;
+
+          //TODO: check CommandEvaluation for correct KeybindMode
+          if (mode == KeybindMode::None)
+            mode = eval.getEvaluatedExecutor()->getKeybindMode();
+
+          commands[mode].push_back(cmd);
+        }
+      }
+    }
+
+    for (unsigned int j = 0; j < 3; j++)
+    {
+      nCommands_[j] = commands[j].size();
+      if (nCommands_[j])
+      {
+        commands_[j] = new BaseCommand*[nCommands_[j]];
+        for (unsigned int i = 0; i < commands[j].size(); i++)
+          commands_[j][i] = commands[j][i];
+      }
+      else
+        commands_[j] = 0;
+    }
+  }
+
+  bool Button::execute(KeybindMode::Enum mode, float abs, float rel)
+  {
+    // execute all the parsed commands in the string
+    for (unsigned int iCommand = 0; iCommand < nCommands_[mode]; iCommand++)
+      commands_[mode][iCommand]->execute(abs, rel);
+    return true;
+  }
+
+  void HalfAxis::clear()
+  {
+    Button::clear();
+    if (nParamCommands_)
+    {
+      // delete all commands and the command pointer array
+      for (unsigned int i = 0; i < nParamCommands_; i++)
+        delete paramCommands_[i];
+      delete[] paramCommands_;
+    }
+    else
+    {
+      nParamCommands_ = 0; nParamCommands_ = 0;
+    }
+  }
+  
+  bool HalfAxis::addParamCommand(ParamCommand* command)
+  {
+    ParamCommand** cmds = paramCommands_;
+    paramCommands_ = new ParamCommand*[++nParamCommands_];
+    unsigned int i;
+    for (i = 0; i < nParamCommands_ - 1; i++)
+      paramCommands_[i] = cmds[i];
+    paramCommands_[i] = command;
+    delete[] cmds;
+    return true;
+  }
+
+  bool HalfAxis::execute()
+  {
+    bool success = true;
+    for (unsigned int i = 0; i < nParamCommands_; i++)
+      success = success && paramCommands_[i]->execute(absVal_, relVal_);
+    return success;
+  }
+
+
+  // ###############################
   // ######     KeyBinder     ######
   // ###############################
@@ -48,193 +305,144 @@
     @brief Constructor that does as little as necessary.
   */
-  KeyBinder::KeyBinder()
+  KeyBinder::KeyBinder() : deriveTime_(0.0f)
   {
     RegisterObject(KeyBinder);
-    clearBindings();
-
+
+    // keys
     std::string keyNames[] = {
-    "UNASSIGNED",
-    "ESCAPE",
-    "1",
-    "2",
-    "3",
-    "4",
-    "5",
-    "6",
-    "7",
-    "8",
-    "9",
-    "0",
-    "MINUS",
-    "EQUALS",
-    "BACK",
-    "TAB",
-    "Q",
-    "W",
-    "E",
-    "R",
-    "T",
-    "Y",
-    "U",
-    "I",
-    "O",
-    "P",
-    "LBRACKET",
-    "RBRACKET",
-    "RETURN",
-    "LCONTROL",
-    "A",
-    "S",
-    "D",
-    "F",
-    "G",
-    "H",
-    "J",
-    "K",
-    "L",
-    "SEMICOLON",
-    "APOSTROPHE",
-    "GRAVE",
-    "LSHIFT",
-    "BACKSLASH",
-    "Z",
-    "X",
-    "C",
-    "V",
-    "B",
-    "N",
-    "M",
-    "COMMA",
-    "PERIOD",
-    "SLASH",
-    "RSHIFT",
-    "MULTIPLY",
-    "LMENU",
-    "SPACE",
-    "CAPITAL",
-    "F1",
-    "F2",
-    "F3",
-    "F4",
-    "F5",
-    "F6",
-    "F7",
-    "F8",
-    "F9",
-    "F10",
-    "NUMLOCK",
-    "SCROLL",
-    "NUMPAD7",
-    "NUMPAD8",
-    "NUMPAD9",
-    "SUBTRACT",
-    "NUMPAD4",
-    "NUMPAD5",
-    "NUMPAD6",
-    "ADD",
-    "NUMPAD1",
-    "NUMPAD2",
-    "NUMPAD3",
-    "NUMPAD0",
-    "DECIMAL",
-    "","",
-    "OEM_102",
-    "F11",
-    "F12",
-    "","","","","","","","","","","",
-    "F13",
-    "F14",
-    "F15",
-    "","","","","","","","","","",
-    "KANA",
-    "","",
-    "ABNT_C1",
-    "","","","","",
-    "CONVERT",
-    "",
-    "NOCONVERT",
-    "",
-    "YEN",
-    "ABNT_C2",
-    "","","","","","","","","","","","","","",
-    "NUMPADEQUALS",
-    "","",
-    "PREVTRACK",
-    "AT",
-    "COLON",
-    "UNDERLINE",
-    "KANJI",
-    "STOP",
-    "AX",
-    "UNLABELED",
-    "NEXTTRACK",
-    "","",
-    "NUMPADENTER",
-    "RCONTROL",
-    "","",
-    "MUTE",
-    "CALCULATOR",
-    "PLAYPAUSE",
-    "",
-    "MEDIASTOP",
-    "","","","","","","","","",
-    "VOLUMEDOWN",
-    "",
-    "VOLUMEUP",
-    "",
-    "WEBHOME",
-    "NUMPADCOMMA",
-    "",
-    "DIVIDE",
-    "",
-    "SYSRQ",
-    "RMENU",
-    "","","","","","","","","","","","",
-    "PAUSE",
-    "",
-    "HOME",
-    "UP",
-    "PGUP",
-    "",
-    "LEFT",
-    "",
-    "RIGHT",
-    "",
-    "END",
-    "DOWN",
-    "PGDOWN",
-    "INSERT",
-    "DELETE",
-    "","","","","","","",
-    "LWIN",
-    "RWIN",
-    "APPS",
-    "POWER",
-    "SLEEP",
-    "","","",
-    "WAKE",
-    "",
-    "WEBSEARCH",
-    "WEBFAVORITES",
-    "WEBREFRESH",
-    "WEBSTOP",
-    "WEBFORWARD",
-    "WEBBACK",
-    "MYCOMPUTER",
-    "MAIL",
-    "MEDIASELECT"
+      "UNASSIGNED",
+      "ESCAPE",
+      "1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
+      "MINUS", "EQUALS", "BACK", "TAB",
+      "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P",
+      "LBRACKET", "RBRACKET",
+      "RETURN", "LCONTROL",
+      "A", "S", "D", "F", "G", "H", "J", "K", "L",
+      "SEMICOLON", "APOSTROPHE", "GRAVE",
+      "LSHIFT", "BACKSLASH",
+      "Z", "X", "C", "V", "B", "N", "M",
+      "COMMA", "PERIOD", "SLASH",
+      "RSHIFT",
+      "MULTIPLY",
+      "LMENU",
+      "SPACE",
+      "CAPITAL",
+      "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10",
+      "NUMLOCK", "SCROLL",
+      "NUMPAD7", "NUMPAD8", "NUMPAD9",
+      "SUBTRACT",
+      "NUMPAD4", "NUMPAD5", "NUMPAD6",
+      "ADD",
+      "NUMPAD1", "NUMPAD2", "NUMPAD3", "NUMPAD0",
+      "DECIMAL",
+      "","",
+      "OEM_102",
+      "F11", "F12",
+      "","","","","","","","","","","",
+      "F13", "F14", "F15",
+      "","","","","","","","","","",
+      "KANA",
+      "","",
+      "ABNT_C1",
+      "","","","","",
+      "CONVERT",
+      "",
+      "NOCONVERT",
+      "",
+      "YEN",
+      "ABNT_C2",
+      "","","","","","","","","","","","","","",
+      "NUMPADEQUALS",
+      "","",
+      "PREVTRACK",
+      "AT",
+      "COLON", "UNDERLINE",
+      "KANJI",
+      "STOP",
+      "AX",
+      "UNLABELED",
+      "NEXTTRACK",
+      "","",
+      "NUMPADENTER",
+      "RCONTROL",
+      "","",
+      "MUTE",
+      "CALCULATOR",
+      "PLAYPAUSE",
+      "",
+      "MEDIASTOP",
+      "","","","","","","","","",
+      "VOLUMEDOWN",
+      "",
+      "VOLUMEUP",
+      "",
+      "WEBHOME",
+      "NUMPADCOMMA",
+      "",
+      "DIVIDE",
+      "",
+      "SYSRQ",
+      "RMENU",
+      "","","","","","","","","","","","",
+      "PAUSE",
+      "",
+      "HOME",
+      "UP",
+      "PGUP",
+      "",
+      "LEFT",
+      "",
+      "RIGHT",
+      "",
+      "END", "DOWN", "PGDOWN", "INSERT", "DELETE",
+      "","","","","","","",
+      "LWIN", "RWIN", "APPS",
+      "POWER", "SLEEP",
+      "","","",
+      "WAKE",
+      "",
+      "WEBSEARCH", "WEBFAVORITES", "WEBREFRESH", "WEBSTOP", "WEBFORWARD", "WEBBACK",
+      "MYCOMPUTER", "MAIL", "MEDIASELECT"
     };
-    for (int i = 0; i < numberOfKeys_s; i++)
-      keyNames_[i] = keyNames[i];
-
+    for (unsigned int i = 0; i < nKeys_s; i++)
+      keys_[i].name_ = "Key" + keyNames[i];
+
+    // mouse buttons
     std::string mouseButtonNames[] = {
       "MouseLeft", "MouseRight", "MouseMiddle",
       "MouseButton3", "MouseButton4", "MouseButton5",
-      "MouseButton6", "MouseButton7" };
-    for (int i = 0; i < numberOfMouseButtons_s; i++)
-      mouseButtonNames_[i] = mouseButtonNames[i];
-
-    for (int i = 0; i < numberOfJoyStickButtons_s; i++)
-      joyStickButtonNames_[i] = "JoyStick" + getConvertedValue<int, std::string>(i);
+      "MouseButton6", "MouseButton7",
+      "MouseWheel1Up", "MouseWheel1Down",
+      "MouseWheel2Up", "MouseWheel2Down" };
+    for (unsigned int i = 0; i < nMouseButtons_s; i++)
+      mouseButtons_[i].name_ = mouseButtonNames[i];
+
+    // joy stick buttons
+    for (unsigned int i = 0; i < 32; i++)
+      joyStickButtons_[i].name_ = "JoyButton" + getConvertedValue<int, std::string>(i);
+    for (unsigned int i = 32; i < nJoyStickButtons_s; i += 4)
+    {
+		  joyStickButtons_[i + 0].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "North";
+		  joyStickButtons_[i + 1].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "South";
+		  joyStickButtons_[i + 2].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "East";
+		  joyStickButtons_[i + 3].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "West";
+    }
+
+    // half axes
+    std::string rawNames[nHalfAxes_s/2];
+    rawNames[0] = "MouseX";
+    rawNames[1] = "MouseY";
+    rawNames[2] = "Empty1";
+    rawNames[3] = "Empty2";
+    for (unsigned int i = 4; i < nHalfAxes_s/2; i++)
+      rawNames[i] = "JoyAxis" + getConvertedValue<int, std::string>(i - 3);
+    for (unsigned int i = 0; i < nHalfAxes_s/2; i++)
+    {
+      halfAxes_[i * 2 + 0].name_ = rawNames[i] + "Pos";
+      halfAxes_[i * 2 + 1].name_ = rawNames[i] + "Neg";
+    }
+
+    for (unsigned int i = 0; i < this->nHalfAxes_s; i++)
+      halfAxes_[i].buttonThreshold_ = buttonThreshold_;
   }
 
@@ -244,4 +452,21 @@
   KeyBinder::~KeyBinder()
   {
+    // almost no destructors required because most of the arrays are static.
+    clearBindings(); // does some destruction work
+  }
+
+  /**
+    @brief Loads the key and button bindings.
+    @return True if loading succeeded.
+  */
+  void KeyBinder::loadBindings()
+  {
+    COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
+
+    ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "keybindings.ini");
+    clearBindings();
+    setConfigValues();
+
+    COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
   }
 
@@ -251,80 +476,47 @@
   void KeyBinder::setConfigValues()
   {
-    ConfigValueContainer* cont;
-    std::string modes[] = {"P_", "R_", "H_"};
+    SetConfigValue(analogThreshold_, 0.01f)  .description("Threshold for analog axes until which the state is 0.");
+    SetConfigValue(bDeriveMouseInput_, false).description("Whether or not to derive moues movement for the absolute value.");
+    SetConfigValue(derivePeriod_, 0.1f)      .description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
+    SetConfigValue(mouseSensitivity_, 1.0f)  .description("Mouse sensitivity.");
+
+    float oldThresh = buttonThreshold_;
+    SetConfigValue(buttonThreshold_, 0.80f).description("Threshold for analog axes until which the button is not pressed.");
+    if (oldThresh != buttonThreshold_)
+      for (unsigned int i = 0; i < nHalfAxes_s; i++)
+        if (halfAxes_[i].buttonThreshold_ == oldThresh)
+          halfAxes_[i].buttonThreshold_ = buttonThreshold_;
 
     // keys
-    for (int i = 0; i < numberOfKeys_s; i++)
-    {
-      for (int j = 0; j < 3; j++)
-      {
-        cont = getIdentifier()->getConfigValueContainer(modes[j] + keyNames_[i]);
-        if (!cont)
-        {
-          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), modes[j] + keyNames_[i], "");
-          getIdentifier()->addConfigValueContainer(modes[j] + keyNames_[i], cont);
-        }
-        switch (j)
-        {
-          case 0:
-            cont->getValue(&bindingsKeyPress_[i].commandStr);
-            break;
-          case 1:
-            cont->getValue(&bindingsKeyRelease_[i].commandStr);
-            break;
-          case 2:
-            cont->getValue(&bindingsKeyHold_[i].commandStr);
-        }
-      }
-    }
-
+    for (unsigned int i = 0; i < nKeys_s; i++)
+      readTrigger(keys_[i]);
     // mouse buttons
-    for (int i = 0; i < numberOfMouseButtons_s; i++)
-    {
-      for (int j = 0; j < 3; j++)
-      {
-        cont = getIdentifier()->getConfigValueContainer(modes[j] + mouseButtonNames_[i]);
-        if (!cont)
-        {
-          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), modes[j] + mouseButtonNames_[i], "");
-          getIdentifier()->addConfigValueContainer(modes[j] + mouseButtonNames_[i], cont);
-        }
-        switch (j)
-        {
-          case 0:
-            cont->getValue(&bindingsMouseButtonPress_[i].commandStr);
-            break;
-          case 1:
-            cont->getValue(&bindingsMouseButtonRelease_[i].commandStr);
-            break;
-          case 2:
-            cont->getValue(&bindingsMouseButtonHold_[i].commandStr);
-        }
-      }
-    }
-
+    for (unsigned int i = 0; i < nMouseButtons_s; i++)
+      readTrigger(mouseButtons_[i]);
     // joy stick buttons
-    for (int i = 0; i < numberOfJoyStickButtons_s; i++)
-    {
-      for (int j = 0; j < 3; j++)
-      {
-        cont = getIdentifier()->getConfigValueContainer(modes[j] + joyStickButtonNames_[i]);
-        if (!cont)
-        {
-          cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), modes[j] + joyStickButtonNames_[i], "");
-          getIdentifier()->addConfigValueContainer(modes[j] + joyStickButtonNames_[i], cont);
-        }
-        switch (j)
-        {
-          case 0:
-            cont->getValue(&bindingsJoyStickButtonPress_[i].commandStr);
-            break;
-          case 1:
-            cont->getValue(&bindingsJoyStickButtonRelease_[i].commandStr);
-            break;
-          case 2:
-            cont->getValue(&bindingsJoyStickButtonHold_[i].commandStr);
-        }
-      }
+    for (unsigned int i = 0; i < nJoyStickButtons_s; i++)
+      readTrigger(joyStickButtons_[i]);
+    // half axes
+    for (unsigned int i = 0; i < nHalfAxes_s; i++)
+      readTrigger(halfAxes_[i]);
+  }
+
+  void KeyBinder::readTrigger(Button& button)
+  {
+    // config value stuff
+    ConfigValueContainer* cont = getIdentifier()->getConfigValueContainer(button.name_);
+    if (!cont)
+    {
+      cont = new ConfigValueContainer(CFT_Keybindings, getIdentifier(), button.name_, "");
+      getIdentifier()->addConfigValueContainer(button.name_, cont);
+    }
+    std::string old = button.bindingString_;
+    cont->getValue(&button.bindingString_);
+
+    // keybinder stuff
+    if (old != button.bindingString_)
+    {
+      // binding has changed
+      button.parse(paramCommandBuffer_);
     }
   }
@@ -333,105 +525,121 @@
     @brief Overwrites all bindings with ""
   */
-  void KeyBinder::clearBindings()
-  {
-    for (int i = 0; i < numberOfKeys_s; i++)
-    {
-      bindingsKeyPress_  [i].commandStr = "";
-      bindingsKeyRelease_[i].commandStr = "";
-      bindingsKeyHold_   [i].commandStr = "";
-    }
-    for (int i = 0; i < numberOfMouseButtons_s; i++)
-    {
-      bindingsMouseButtonPress_  [i].commandStr = "";
-      bindingsMouseButtonRelease_[i].commandStr = "";
-      bindingsMouseButtonHold_   [i].commandStr = "";
-    }
-    for (int i = 0; i < numberOfJoyStickButtons_s; i++)
-    {
-      bindingsJoyStickButtonPress_  [i].commandStr = "";
-      bindingsJoyStickButtonRelease_[i].commandStr = "";
-      bindingsJoyStickButtonHold_   [i].commandStr = "";
-    }
-  }
-
-  /**
-    @brief Loads the key and button bindings.
-    @return True if loading succeeded.
-  */
-  bool KeyBinder::loadBindings()
-  {
-    COUT(ORX_DEBUG) << "KeyBinder: Loading key bindings..." << std::endl;
-
-    ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "keybindings.ini");
-    setConfigValues();
-
-    // evaluate the key bindings
-    // TODO: what if binding is invalid?
-    for (int i = 0; i < numberOfKeys_s; i++)
-    {
-      if (bindingsKeyPress_[i].commandStr != "")
+  void KeyBinder::clearBindings(bool bInit)
+  {
+    for (unsigned int i = 0; i < nKeys_s; i++)
+      keys_[i].clear();
+
+    for (unsigned int i = 0; i < nMouseButtons_s; i++)
+      mouseButtons_[i].clear();
+
+    for (unsigned int i = 0; i < nJoyStickButtons_s; i++)
+      joyStickButtons_[i].clear();
+
+    for (unsigned int i = 0; i < nHalfAxes_s; i++)
+      halfAxes_[i].clear();
+
+    for (unsigned int i = 0; i < paramCommandBuffer_.size(); i++)
+      delete paramCommandBuffer_[i];
+    paramCommandBuffer_.clear();
+  }
+
+  void KeyBinder::tick(float dt)
+  {
+    // we have to process all the analog input since there is e.g. no 'mouseDoesntMove' event.
+    for (unsigned int i = 0; i < nHalfAxes_s; i++)
+    {
+      if (halfAxes_[i].hasChanged_)
       {
-        bindingsKeyPress_[i].evaluation = CommandExecutor::evaluate(bindingsKeyPress_[i].commandStr);
-        bindingsKeyPress_[i].commandStr = bindingsKeyPress_[i].evaluation.getCommandString();
+        if (!halfAxes_[i].wasDown_ && halfAxes_[i].absVal_ > halfAxes_[i].buttonThreshold_)
+        {
+          halfAxes_[i].wasDown_ = true;
+          if (halfAxes_[i].nCommands_[KeybindMode::OnPress])
+            halfAxes_[i].execute(KeybindMode::OnPress);
+        }
+        else if (halfAxes_[i].wasDown_ && halfAxes_[i].absVal_ < halfAxes_[i].buttonThreshold_)
+        {
+          halfAxes_[i].wasDown_ = false;
+          if (halfAxes_[i].nCommands_[KeybindMode::OnRelease])
+            halfAxes_[i].execute(KeybindMode::OnRelease);
+        }
+        if (halfAxes_[i].wasDown_)
+        {
+          if (halfAxes_[i].nCommands_[KeybindMode::OnHold])
+            halfAxes_[i].execute(KeybindMode::OnHold);
+        }
+        halfAxes_[i].hasChanged_ = false;
       }
-    }
-
-    COUT(ORX_DEBUG) << "KeyBinder: Loading key bindings done." << std::endl;
-    return true;
-  }
-
-  bool KeyBinder::executeSimpleBinding(KeyBinding& binding)
-  {
-    if (binding.commandStr != "")
-    {
-      if (binding.commandStr != binding.evaluation.getCommandString())
+
+      // these are the actually useful axis bindings for analog input AND output
+      if (halfAxes_[i].relVal_ > analogThreshold_ || halfAxes_[i].absVal_ > analogThreshold_)
       {
-        // key binding has changed, reevaluate the command string.
-        binding.evaluation = CommandExecutor::evaluate(binding.commandStr);
-        binding.commandStr = binding.evaluation.getCommandString();
+        halfAxes_[i].execute();
       }
-      COUT(ORX_DEBUG) << "Keybinding: Executing command: " << binding.commandStr << std::endl;
-      CommandExecutor::execute(binding.commandStr);
-    }
-
-    return true;
-  }
-
-
-  /**
-    @brief Event handler for the keyPressed Event.
-    @param e Event information
-  */
-  bool KeyBinder::keyPressed(const KeyEvent& evt)
-  {
-    // find the appropriate key binding
-    executeSimpleBinding(bindingsKeyPress_[int(evt.key)]);
-
-    return true;
-  }
-
-  /**
-    @brief Event handler for the keyReleased Event.
-    @param e Event information
-  */
-  bool KeyBinder::keyReleased(const KeyEvent& evt)
-  {
-    // find the appropriate key binding
-    executeSimpleBinding(bindingsKeyRelease_[int(evt.key)]);
-
-    return true;
-  }
-
-  /**
-    @brief Event handler for the keyHeld Event.
-    @param e Mouse state information
-  */
-  bool KeyBinder::keyHeld(const KeyEvent& evt)
-  {
-    // find the appropriate key binding
-    executeSimpleBinding(bindingsKeyHold_[int(evt.key)]);
-
-    return true;
-  }
+    }
+
+    if (bDeriveMouseInput_)
+    {
+      if (deriveTime_ > derivePeriod_)
+      {
+        deriveTime_ = 0.0f;
+        //CCOUT(3) << "mouse abs: ";
+        for (int i = 0; i < 2; i++)
+        {
+          if (mouseRelative_[i] > 0)
+          {
+            halfAxes_[2*i + 0].absVal_ = mouseRelative_[i] * derivePeriod_ / 500 * mouseSensitivity_;
+            halfAxes_[2*i + 1].absVal_ = 0.0f;
+          }
+          else if (mouseRelative_[0] < 0)
+          {
+            halfAxes_[2*i + 0].absVal_ = 0.0f;
+            halfAxes_[2*i + 1].absVal_ = -mouseRelative_[i] * derivePeriod_ / 500 * mouseSensitivity_;
+          }
+          //COUT(3) << mouseRelative_[i] << " | ";
+          mouseRelative_[i] = 0;
+        }
+        //COUT(3) << std::endl;
+      }
+      else
+        deriveTime_ += dt;
+    }
+
+    // execute all buffered bindings (addional parameter)
+    for (unsigned int i = 0; i < paramCommandBuffer_.size(); i++)
+      paramCommandBuffer_[i]->execute();
+
+    // always reset the relative movement of the mouse
+    for (unsigned int i = 0; i < 8; i++)
+      halfAxes_[i].relVal_ = 0.0f;
+  }
+
+  void KeyBinder::keyPressed (const KeyEvent& evt)
+  { keys_[evt.key].execute(KeybindMode::OnPress); }
+
+  void KeyBinder::keyReleased(const KeyEvent& evt)
+  { keys_[evt.key].execute(KeybindMode::OnRelease); }
+
+  void KeyBinder::keyHeld    (const KeyEvent& evt)
+  { keys_[evt.key].execute(KeybindMode::OnHold); }
+
+
+  void KeyBinder::mouseButtonPressed (MouseButton::Enum id)
+  { mouseButtons_[id].execute(KeybindMode::OnPress); }
+
+  void KeyBinder::mouseButtonReleased(MouseButton::Enum id)
+  { mouseButtons_[id].execute(KeybindMode::OnRelease); }
+
+  void KeyBinder::mouseButtonHeld    (MouseButton::Enum id)
+  { mouseButtons_[id].execute(KeybindMode::OnHold); }
+
+
+  void KeyBinder::joyStickButtonPressed (int joyStickID, int button)
+  { joyStickButtons_[button].execute(KeybindMode::OnPress); }
+
+  void KeyBinder::joyStickButtonReleased(int joyStickID, int button)
+  { joyStickButtons_[button].execute(KeybindMode::OnRelease); }
+
+  void KeyBinder::joyStickButtonHeld    (int joyStickID, int button)
+  { joyStickButtons_[button].execute(KeybindMode::OnHold); }
 
   /**
@@ -439,21 +647,58 @@
     @param e Mouse state information
   */
-  bool KeyBinder::mouseMoved(const MouseState &evt)
-  {
-    /*if (bindingMouseMoved_.commandStr != "")
-    {
-      if (bindingMouseMoved_.commandStr != bindingMouseMoved_.evaluation.getCommandString())
+  void KeyBinder::mouseMoved(IntVector2 abs_, IntVector2 rel_, IntVector2 clippingSize)
+  {
+    if (!bDeriveMouseInput_)
+    {
+      // y axis of mouse input is inverted
+      int rel[] = { rel_.x, -rel_.y };
+
+      //COUT(3) << rel[0] << " | " << rel[1] << std::endl;
+
+      for (int i = 0; i < 2; i++)
       {
-        // key binding has changed, reevaluate the command string.
-        bindingMouseMoved_.evaluation = CommandExecutor::evaluate(bindingMouseMoved_.commandStr);
-        bindingMouseMoved_.commandStr = bindingMouseMoved_.evaluation.getCommandString();
+        if (rel[i])
+        {
+          // absolute
+          if (mousePosition_[i] >= 0)
+          {
+            mousePosition_[i] += rel[i];
+            halfAxes_[0 + 2*i].hasChanged_ = true;
+            if (mousePosition_[i] < 0)
+            {
+              halfAxes_[1 + 2*i].hasChanged_ = true;
+              halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024 * mouseSensitivity_;
+              halfAxes_[0 + 2*i].absVal_ =  0.0f;
+            }
+            else
+              halfAxes_[1 + 2*i].absVal_ =  ((float)mousePosition_[i])/1024 * mouseSensitivity_;
+          }
+          else
+          {
+            mousePosition_[i] += rel[i];
+            halfAxes_[1 + 2*i].hasChanged_ = true;
+            if (mousePosition_[i] > 0)
+            {
+              halfAxes_[0 + 2*i].hasChanged_ = true;
+              halfAxes_[0 + 2*i].absVal_ =  ((float)mousePosition_[i])/1024 * mouseSensitivity_;
+              halfAxes_[1 + 2*i].absVal_ =  0.0f;
+            }
+            else
+              halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024 * mouseSensitivity_;
+          }
+
+          // relative
+          if (rel[i] > 0)
+            halfAxes_[0 + 2*i].relVal_ =  ((float)rel[i])/1024 * mouseSensitivity_;
+          else
+            halfAxes_[1 + 2*i].relVal_ = -((float)rel[i])/1024 * mouseSensitivity_;
+        }
       }
-      COUT(3) << "Executing command: " << bindingMouseMoved_.commandStr << std::endl;
-
-      bindingMouseMoved_.evaluation.setEvaluatedParameter(
-      CommandExecutor::execute(bindingMouseMoved_.commandStr);
-    }*/
-
-    return true;
+    }
+    else
+    {
+      mouseRelative_[0] += rel_.x;
+      mouseRelative_[1] -= rel_.y;
+    }
   }
 
@@ -462,92 +707,33 @@
     @param e Mouse state information
   */
-  bool KeyBinder::mouseScrolled(const MouseState &evt)
-  {
-    return true;
-  }
-
-  /**
-    @brief Event handler for the mousePressed Event.
-    @param e Event information
-    @param id The ID of the mouse button
-  */
-  bool KeyBinder::mouseButtonPressed(const MouseState& state, MouseButton::Enum id)
-  {
-    // find the appropriate key binding
-    executeSimpleBinding(bindingsMouseButtonPress_[int(id)]);
-
-    return true;
-  }
-
-  /**
-    @brief Event handler for the mouseReleased Event.
-    @param e Event information
-    @param id The ID of the mouse button
-  */
-  bool KeyBinder::mouseButtonReleased(const MouseState& state, MouseButton::Enum id)
-  {
-    // find the appropriate key binding
-    executeSimpleBinding(bindingsMouseButtonRelease_[int(id)]);
-
-    return true;
-  }
-
-  /**
-    @brief Event handler for the mouseHeld Event.
-    @param e Event information
-    @param id The ID of the mouse button
-  */
-  bool KeyBinder::mouseButtonHeld(const MouseState& state, MouseButton::Enum id)
-  {
-    // find the appropriate key binding
-    executeSimpleBinding(bindingsMouseButtonHold_[int(id)]);
-
-    return true;
-  }
-
-  bool KeyBinder::joyStickButtonPressed(const JoyStickState& state, int button)
-  {
-    // find the appropriate key binding
-    executeSimpleBinding(bindingsJoyStickButtonPress_[button]);
-
-    return true;
-  }
-
-  bool KeyBinder::joyStickButtonReleased(const JoyStickState& state, int button)
-  {
-    // find the appropriate key binding
-    executeSimpleBinding(bindingsJoyStickButtonRelease_[button]);
-
-    return true;
-  }
-
-  bool KeyBinder::joyStickButtonHeld(const JoyStickState& state, int button)
-  {
-    // find the appropriate key binding
-    executeSimpleBinding(bindingsJoyStickButtonHold_[button]);
-
-    return true;
-  }
-
-  bool KeyBinder::joyStickAxisMoved(const JoyStickState& state, int axis)
-  {
-    return true;
-  }
-
-  bool KeyBinder::joyStickSliderMoved(const JoyStickState& state, int index)
-  {
-    return true;
-  }
-
-  bool KeyBinder::joyStickPovMoved(const JoyStickState& state, int index)
-  {
-    return true;
-  }
-
-  bool KeyBinder::joyStickVector3Moved(const JoyStickState& state, int index)
-  {
-    return true;
-  }
-
+  void KeyBinder::mouseScrolled(int abs, int rel)
+  {
+    //COUT(3) << mouseButtons_[8].name_ << "   " << abs << " | " << rel << std::endl;
+
+    if (rel > 0)
+      for (int i = 0; i < rel/120; i++)
+        mouseButtons_[8].execute(KeybindMode::OnPress, ((float)abs)/120.0f);
+    else
+      for (int i = 0; i < -rel/120; i++)
+        mouseButtons_[9].execute(KeybindMode::OnPress, ((float)abs)/120.0f);
+  }
+
+  void KeyBinder::joyStickAxisMoved(int joyStickID, int axis, int value)
+  {
+    // TODO: check whether 16 bit integer as general axis value is a good idea (works under windows)
+    CCOUT(3) << halfAxes_[8 + axis].name_ << std::endl;
+    if (value >= 0)
+    {
+      halfAxes_[8 + axis].absVal_ = ((float)value)/0x8000;
+      halfAxes_[8 + axis].relVal_ = ((float)value)/0x8000;
+      halfAxes_[8 + axis].hasChanged_ = true;
+    }
+    else
+    {
+      halfAxes_[8 + axis + 1].absVal_ = -((float)value)/0x8000;
+      halfAxes_[8 + axis + 1].relVal_ = -((float)value)/0x8000;
+      halfAxes_[8 + axis + 1].hasChanged_ = true;
+    }
+  }
 
 
Index: /code/trunk/src/core/InputHandler.h
===================================================================
--- /code/trunk/src/core/InputHandler.h	(revision 1348)
+++ /code/trunk/src/core/InputHandler.h	(revision 1349)
@@ -38,6 +38,8 @@
 
 #include <string>
+#include <vector>
 
 #include "ois/OIS.h"
+#include "util/Math.h"
 #include "OrxonoxClass.h"
 #include "CommandExecutor.h"
@@ -46,24 +48,91 @@
 namespace orxonox
 {
-  namespace KeybindSetting
-  {
-    enum KeybindSetting
-    {
-      None,
-      OnPress,
-      OnRelease,
-      Continuous,
-    };
-  }
-
-  struct _CoreExport KeyBinding
-  {
-    std::string commandStr;
-    CommandEvaluation evaluation;
-  };
- 
+  class _CoreExport BaseCommand
+  {
+  public:
+    virtual ~BaseCommand() { }
+    virtual bool execute(float abs = 1.0f, float rel = 1.0f) = 0;
+  };
+
+  class _CoreExport BufferedParamCommand
+  {
+  public:
+    BufferedParamCommand() : value_(0.0f), nValuesAdded_(0), paramIndex_(-1) { }
+    bool execute();
+
+    float value_;
+    unsigned int nValuesAdded_;
+    int paramIndex_;
+    CommandEvaluation evaluation_;
+  };
+
+  class _CoreExport SimpleCommand : public BaseCommand
+  {
+  public:
+    bool execute(float abs = 1.0f, float rel = 1.0f);
+
+    CommandEvaluation evaluation_;
+  };
+
+  class _CoreExport ParamCommand : public BaseCommand
+  {
+  public:
+    ParamCommand() : bRelative_(false), paramModifier_(1.0f), paramCommand_(0) { }
+    bool execute(float abs = 1.0f, float rel = 1.0f);
+
+    bool bRelative_;
+    float paramModifier_;
+    BufferedParamCommand* paramCommand_;
+  };
+
+  class _CoreExport Button
+  {
+  public:
+    Button() { nCommands_[0]=0; nCommands_[1]=0; nCommands_[2]=0; clear(); }
+    virtual ~Button() { clear(); }
+    virtual void clear();
+    virtual bool addParamCommand(ParamCommand* command) { return false; }
+    void parse(std::vector<BufferedParamCommand*>& paramCommandBuffer);
+    bool execute(KeybindMode::Enum mode, float abs = 1.0f, float rel = 1.0f);
+
+    //! The configured string value
+    std::string bindingString_;
+    //! Name of the trigger as strings
+    std::string name_;
+    //! Basic commands for OnPress, OnHold and OnRelease
+    BaseCommand** commands_[3];
+    //! Number of basic commands
+    unsigned int nCommands_[3];
+    //! Says how much it takes for an analog axis to trigger a button
+    //! Note: This variable is here to have only one parse() function.
+    float buttonThreshold_;
+  };
+
+
+  class _CoreExport HalfAxis : public Button
+  {
+  public:
+    HalfAxis() : relVal_(0.0f), absVal_(0.0f), paramCommands_(0), nParamCommands_(0),
+                 wasDown_(false), hasChanged_(false) { }
+    using Button::execute;
+    bool execute();
+    //bool execute(KeybindMode::Enum mode) { return Button::execute(mode); }
+    bool addParamCommand(ParamCommand* command);
+    void clear();
+
+    // axis related
+    float relVal_;
+    float absVal_;
+    ParamCommand** paramCommands_;
+    unsigned int nParamCommands_;
+
+    // button related
+    bool wasDown_;
+    bool hasChanged_;
+  };
+
 
   /**
-    @brief Captures mouse, keyboard and joy stick input while in the actual game mode.
+    @brief Handles mouse, keyboard and joy stick input while in the actual game mode.
            Manages the key bindings.
   */
@@ -74,70 +143,85 @@
     ~KeyBinder();
 
-    bool loadBindings();
-    void clearBindings();
+    void loadBindings();
+    void clearBindings(bool bInit = false);
 
     void setConfigValues();
 
   private: // functions
-
-    bool executeSimpleBinding(KeyBinding &binding);
-
-    bool keyPressed (const KeyEvent& evt);
-    bool keyReleased(const KeyEvent& evt);
-    bool keyHeld    (const KeyEvent& evt);
-
-    bool mouseButtonPressed (const MouseState& state, MouseButton::Enum id);
-    bool mouseButtonReleased(const MouseState& state, MouseButton::Enum id);
-    bool mouseButtonHeld    (const MouseState& state, MouseButton::Enum id);
-    bool mouseMoved         (const MouseState& state);
-    bool mouseScrolled      (const MouseState& state);
-
-    bool joyStickButtonPressed (const JoyStickState& state, int button);
-    bool joyStickButtonReleased(const JoyStickState& state, int button);
-    bool joyStickButtonHeld    (const JoyStickState& state, int button);
-    bool joyStickAxisMoved     (const JoyStickState& state, int axis)  ;
-    bool joyStickSliderMoved   (const JoyStickState& state, int index) ;
-    bool joyStickPovMoved      (const JoyStickState& state, int index) ;
-    bool joyStickVector3Moved  (const JoyStickState& state, int index) ;
+    void readTrigger(Button& button);
+
+    //static void clearBundle(KeyBindingBundle& bundle, bool bInit);
+    //static void redimensionBinding(KeyBinding& binding);
+
+    void tick(float dt);
+
+    void keyPressed (const KeyEvent& evt);
+    void keyReleased(const KeyEvent& evt);
+    void keyHeld    (const KeyEvent& evt);
+
+    void mouseButtonPressed (MouseButton::Enum id);
+    void mouseButtonReleased(MouseButton::Enum id);
+    void mouseButtonHeld    (MouseButton::Enum id);
+    void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
+    void mouseScrolled      (int abs, int rel);
+
+    void joyStickButtonPressed (int joyStickID, int button);
+    void joyStickButtonReleased(int joyStickID, int button);
+    void joyStickButtonHeld    (int joyStickID, int button);
+    void joyStickAxisMoved     (int joyStickID, int axis, int value);
 
   private: // variables
-
     //! denotes the number of different keys there are in OIS.
-    static const int numberOfKeys_s = 0xEE;
-    //! Array of input events for every pressed key
-    KeyBinding bindingsKeyPress_  [numberOfKeys_s];
-    //! Array of input events for every released key
-    KeyBinding bindingsKeyRelease_[numberOfKeys_s];
-    //! Array of input events for every held key
-    KeyBinding bindingsKeyHold_   [numberOfKeys_s];
-    //! Names of the keys as strings
-    std::string keyNames_[numberOfKeys_s];
+    static const unsigned int nKeys_s = 0xEE;
+    //! Actual key bindings as bundle for Press, Hold and Release
+    Button keys_ [nKeys_s];
 
     //! denotes the number of different mouse buttons there are in OIS.
-    static const int numberOfMouseButtons_s = 8;
-    //! Array of input events for every pressed mouse button
-    KeyBinding bindingsMouseButtonPress_  [numberOfMouseButtons_s];
-    //! Array of input events for every released mouse button
-    KeyBinding bindingsMouseButtonRelease_[numberOfMouseButtons_s];
-    //! Array of input events for every held mouse button
-    KeyBinding bindingsMouseButtonHold_   [numberOfMouseButtons_s];
-    //! Key binding for mouse moved event
-    KeyBinding bindingMouseMoved_;
-    //! Key binding for mouse scrolled event
-    KeyBinding bindingMouseScrolled_;
-    //! Names of the mouse buttons as strings
-    std::string mouseButtonNames_[numberOfMouseButtons_s];
+    static const unsigned int nMouseButtons_s = 8 + 2*2; // 8 buttons and 2 scroll wheels
+    //! Actual key bindings as bundle for Press, Hold and Release
+    Button mouseButtons_ [nMouseButtons_s];
 
     //! denotes the number of different joy stick buttons there are in OIS.
-    static const int numberOfJoyStickButtons_s = 32;
-    //! Array of input events for every pressed joy stick button
-    KeyBinding bindingsJoyStickButtonPress_  [numberOfJoyStickButtons_s];
-    //! Array of input events for every released joy stick button
-    KeyBinding bindingsJoyStickButtonRelease_[numberOfJoyStickButtons_s];
-    //! Array of input events for every held joy stick button
-    KeyBinding bindingsJoyStickButtonHold_   [numberOfJoyStickButtons_s];
-    //! Names of the joy stick buttons as strings
-    std::string joyStickButtonNames_[numberOfJoyStickButtons_s];
-
+    static const unsigned int nJoyStickButtons_s = 32 + 4 * 4; // 32 buttons and 4 POVs with 4 buttons
+    //! Actual key bindings as bundle for Press, Hold and Release
+    Button joyStickButtons_ [nJoyStickButtons_s];
+
+    //! denotes the number of half axes (every axis twice) there can be.
+    static const unsigned int nHalfAxes_s = 56;
+    /**
+    * Array with all the half axes for mouse and joy sticks.
+    * Keep in mind that the positions are fixed and that the first entry is the
+    * positive one and the second is negative.
+    * Sequence is as follows:
+    *  0 -  3: Mouse x and y
+    *  4 -  7: empty
+    *  8 - 23: joy stick (slider) axes 1 to 8
+    * 24 - 55: joy stick axes 1 - 16
+    */
+    HalfAxis halfAxes_[nHalfAxes_s];
+
+    /**
+    * Commands that have additional parameters (axes) are executed at the end of
+    * the tick() so that all values can be buffered for single execution.
+    */
+    std::vector<BufferedParamCommand*> paramCommandBuffer_;
+
+    //! Keeps track of the absolute mouse value (incl. scroll wheel)
+    int mousePosition_[3];
+    //! Used to derive mouse input if requested
+    int mouseRelative_[2];
+    float deriveTime_;
+
+    //##### ConfigValues #####
+    //! Threshold for analog triggers until which the state is 0.
+    float analogThreshold_;
+    //! Threshold for analog triggers until which the button is not pressed.
+    float buttonThreshold_;
+    //! Derive mouse input for absolute values?
+    bool bDeriveMouseInput_;
+    //! Accuracy of the mouse input deriver. The higher the more precise, but laggier.
+    float derivePeriod_;
+    //! mouse sensitivity
+    float mouseSensitivity_;
   };
 
Index: /code/trunk/src/core/InputInterfaces.h
===================================================================
--- /code/trunk/src/core/InputInterfaces.h	(revision 1348)
+++ /code/trunk/src/core/InputInterfaces.h	(revision 1349)
@@ -38,4 +38,5 @@
 
 #include "ois/OIS.h"
+#include "util/Math.h"
 
 namespace orxonox
@@ -239,7 +240,7 @@
   };
 
-  typedef OIS::MouseState MouseState;
-
-  class _CoreExport JoyStickState : OIS::JoyStickState
+  //typedef OIS::MouseState MouseState;
+
+  /*class _CoreExport JoyStickState
   {
   public:
@@ -247,4 +248,16 @@
     JoyStickState() { clear(); }
     int mJoyStickID;
+		JoyStickState() { clear(); }
+
+		std::vector<bool> mButtons;
+		int axes[16];
+		std::vector<Vector3> mVectors;
+  };*/
+
+  class _CoreExport InputTickable
+  {
+  public:
+    virtual ~InputTickable() { }
+    virtual void tick(float dt) = 0;
   };
 
@@ -252,11 +265,11 @@
     @brief Interface class used for key input listeners.
   */
-  class _CoreExport KeyHandler
+  class _CoreExport KeyHandler : virtual public InputTickable
   {
   public:
     virtual ~KeyHandler() { }
-    virtual bool keyPressed (const KeyEvent& evt) = 0;
-    virtual bool keyReleased(const KeyEvent& evt) = 0;
-    virtual bool keyHeld    (const KeyEvent& evt) = 0;
+    virtual void keyPressed (const KeyEvent& evt) = 0;
+    virtual void keyReleased(const KeyEvent& evt) = 0;
+    virtual void keyHeld    (const KeyEvent& evt) = 0;
   };
 
@@ -264,13 +277,13 @@
     @brief Interface class used for mouse input listeners.
   */
-  class _CoreExport MouseHandler 
+  class _CoreExport MouseHandler : virtual public InputTickable
   {
   public:
     virtual ~MouseHandler() { }
-    virtual bool mouseButtonPressed (const MouseState& state, MouseButton::Enum id) = 0;
-    virtual bool mouseButtonReleased(const MouseState& state, MouseButton::Enum id) = 0;
-    virtual bool mouseButtonHeld    (const MouseState& state, MouseButton::Enum id) = 0;
-    virtual bool mouseMoved         (const MouseState& state) = 0;
-    virtual bool mouseScrolled      (const MouseState& state) = 0;
+    virtual void mouseButtonPressed (MouseButton::Enum id) = 0;
+    virtual void mouseButtonReleased(MouseButton::Enum id) = 0;
+    virtual void mouseButtonHeld    (MouseButton::Enum id) = 0;
+    virtual void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) = 0;
+    virtual void mouseScrolled      (int abs, int rel)     = 0;
   };
 
@@ -279,15 +292,13 @@
     @brief Interface class used for joy stick input listeners.
   */
-  class _CoreExport JoyStickHandler
+  class _CoreExport JoyStickHandler : virtual public InputTickable
   {
   public:
     virtual ~JoyStickHandler() { }
-    virtual bool joyStickButtonPressed (const JoyStickState& state, int button) = 0;
-    virtual bool joyStickButtonReleased(const JoyStickState& state, int button) = 0;
-    virtual bool joyStickButtonHeld    (const JoyStickState& state, int button) = 0;
-    virtual bool joyStickAxisMoved     (const JoyStickState& state, int axis)   = 0;
-    virtual bool joyStickSliderMoved   (const JoyStickState& state, int index) {return true;}
-    virtual bool joyStickPovMoved      (const JoyStickState& state, int index) {return true;}
-    virtual bool joyStickVector3Moved  (const JoyStickState& state, int index) {return true;}
+    virtual void joyStickButtonPressed (int joyStickID, int button) = 0;
+    virtual void joyStickButtonReleased(int joyStickID, int button) = 0;
+    virtual void joyStickButtonHeld    (int joyStickID, int button) = 0;
+    virtual void joyStickAxisMoved     (int joyStickID, int axis, int value) = 0;
+    //virtual bool joyStickVector3Moved  (int joyStickID, int index /*, fill list*/) {return true;}
   };
 
Index: /code/trunk/src/core/InputManager.cc
===================================================================
--- /code/trunk/src/core/InputManager.cc	(revision 1348)
+++ /code/trunk/src/core/InputManager.cc	(revision 1349)
@@ -98,5 +98,6 @@
       windowHndStr << (unsigned int)windowHnd;
       paramList.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
-
+      //paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
+      //paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND")));
 //#if defined OIS_LINUX_PLATFORM
 //      paramList.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
@@ -126,5 +127,11 @@
 
       // Set mouse/joystick region
-      setWindowExtents(windowWidth, windowHeight);
+      if (mouse_)
+      {
+        //// hack the mouse position
+        //((OIS::MouseState&)mouse_->getMouseState()).X.abs = windowWidth/2;
+        //((OIS::MouseState&)mouse_->getMouseState()).Y.abs = windowHeight/2;
+        setWindowExtents(windowWidth, windowHeight);
+      }
 
       state_ = IS_NONE;
@@ -267,4 +274,6 @@
     activeJoyStickHandlers_.resize(joySticksSize_);
     joyStickButtonsDown_.resize(joySticksSize_);
+    povStates_.resize(joySticksSize_);
+    sliderStates_.resize(joySticksSize_);
     return success;
   }
@@ -350,4 +359,22 @@
   }
 
+  void InputManager::_updateTickables()
+  {
+    // we can use a set to have a list of unique pointers (an object can implement all 3 handlers)
+    std::set<InputTickable*> tempSet;
+    for (unsigned int iHandler = 0; iHandler < activeKeyHandlers_.size(); iHandler++)
+      tempSet.insert(activeKeyHandlers_[iHandler]);
+    for (unsigned int iHandler = 0; iHandler < activeMouseHandlers_.size(); iHandler++)
+      tempSet.insert(activeMouseHandlers_[iHandler]);
+    for (unsigned int iJoyStick  = 0; iJoyStick < joySticksSize_; iJoyStick++)
+      for (unsigned int iHandler = 0; iHandler  < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
+        tempSet.insert(activeJoyStickHandlers_[iJoyStick][iHandler]);
+
+    // copy the content of the set back to the actual vector
+    activeHandlers_.clear();
+    for (std::set<InputTickable*>::const_iterator itHandler = tempSet.begin(); itHandler != tempSet.end(); itHandler++)
+      activeHandlers_.push_back(*itHandler);
+  }
+
 
   // #################################
@@ -380,24 +407,19 @@
           // normal play mode
           // note: we assume that the handlers exist since otherwise, something's wrong anyway.
-          activeKeyHandlers_.push_back(keyHandlers_["keybinder"]);
-          activeMouseHandlers_.push_back(mouseHandlers_["keybinder"]);
-          if (getMouseHandler("SpaceShip"))
-            activeMouseHandlers_.push_back(mouseHandlers_["SpaceShip"]);
-          for (unsigned int i = 0; i < joySticksSize_; i++)
-            activeJoyStickHandlers_[i].push_back(joyStickHandlers_["keybinder"]);
+          enableKeyHandler("keybinder");
+          enableMouseHandler("keybinder");
+          enableMouseHandler("SpaceShip");
+          enableJoyStickHandler("keybinder", 0);
           break;
 
         case IS_GUI:
-          // FIXME: do stuff
+          // TODO: do stuff
           break;
 
         case IS_CONSOLE:
-          activeMouseHandlers_.push_back(mouseHandlers_["keybinder"]);
-          if (getMouseHandler("SpaceShip"))
-            activeMouseHandlers_.push_back(mouseHandlers_["SpaceShip"]);
-          for (unsigned int i = 0; i < joySticksSize_; i++)
-            activeJoyStickHandlers_[i].push_back(joyStickHandlers_["keybinder"]);
-
-          activeKeyHandlers_.push_back(keyHandlers_["buffer"]);
+          enableMouseHandler("keybinder");
+          enableMouseHandler("SpaceShip");
+          enableJoyStickHandler("keybinder", 0);
+          enableKeyHandler("buffer");
           break;
 
@@ -426,5 +448,5 @@
     for (unsigned int iButton = 0; iButton < mouseButtonsDown_.size(); iButton++)
       for (unsigned int iHandler = 0; iHandler < activeMouseHandlers_.size(); iHandler++)
-        activeMouseHandlers_[iHandler]->mouseButtonHeld(mouse_->getMouseState(), mouseButtonsDown_[iButton]);
+        activeMouseHandlers_[iHandler]->mouseButtonHeld(mouseButtonsDown_[iButton]);
 
     // call all the handlers for the held joy stick button events
@@ -432,6 +454,10 @@
       for (unsigned int iButton   = 0; iButton   < joyStickButtonsDown_[iJoyStick].size(); iButton++)
         for (unsigned int iHandler = 0; iHandler  < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-          activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonHeld(
-              JoyStickState(joySticks_[iJoyStick]->getJoyStickState(), iJoyStick), joyStickButtonsDown_[iJoyStick][iButton]);
+          activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonHeld(iJoyStick, joyStickButtonsDown_[iJoyStick][iButton]);
+
+
+    // call the ticks
+    for (unsigned int iHandler = 0; iHandler < activeHandlers_.size(); iHandler++)
+      activeHandlers_[iHandler]->tick(dt);
   }
 
@@ -508,5 +534,6 @@
     {
       for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
-        activeMouseHandlers_[i]->mouseMoved(e.state);
+        activeMouseHandlers_[i]->mouseMoved(IntVector2(e.state.X.abs, e.state.Y.abs),
+            IntVector2(e.state.X.rel, e.state.Y.rel), IntVector2(e.state.width, e.state.height));
     }
 
@@ -515,5 +542,5 @@
     {
       for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
-        activeMouseHandlers_[i]->mouseScrolled(e.state);
+        activeMouseHandlers_[i]->mouseScrolled(e.state.Z.abs, e.state.Z.rel);
     }
 
@@ -536,5 +563,5 @@
 
     for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
-      activeMouseHandlers_[i]->mouseButtonPressed(e.state, (MouseButton::Enum)id);
+      activeMouseHandlers_[i]->mouseButtonPressed((MouseButton::Enum)id);
 
     return true;
@@ -559,5 +586,5 @@
 
     for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++)
-      activeMouseHandlers_[i]->mouseButtonReleased(e.state, (MouseButton::Enum)id);
+      activeMouseHandlers_[i]->mouseButtonReleased((MouseButton::Enum)id);
 
     return true;
@@ -584,5 +611,5 @@
 
     for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonPressed(JoyStickState(arg.state, iJoyStick), button);
+      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonPressed(iJoyStick, button);
 
     return true;
@@ -609,5 +636,5 @@
 
     for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonReleased(JoyStickState(arg.state, iJoyStick), button);
+      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonReleased(iJoyStick, button);
 
     return true;
@@ -616,4 +643,5 @@
   bool InputManager::axisMoved(const OIS::JoyStickEvent &arg, int axis)
   {
+    //CCOUT(3) << arg.state.mAxes[axis].abs << std::endl;
     // use the device to identify which one called the method
     OIS::JoyStick* joyStick = (OIS::JoyStick*)arg.device;
@@ -622,6 +650,7 @@
       iJoyStick++;
 
+    // keep in mind that the first 8 axes are reserved for the sliders
     for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickAxisMoved(JoyStickState(arg.state, iJoyStick), axis);
+      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickAxisMoved(iJoyStick, axis + 8, arg.state.mAxes[axis].abs);
 
     return true;
@@ -630,4 +659,5 @@
   bool InputManager::sliderMoved(const OIS::JoyStickEvent &arg, int id)
   {
+    //CCOUT(3) << arg.state.mSliders[id].abX << "\t |" << arg.state.mSliders[id].abY << std::endl;
     // use the device to identify which one called the method
     OIS::JoyStick* joyStick = (OIS::JoyStick*)arg.device;
@@ -636,6 +666,18 @@
       iJoyStick++;
 
-    for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickSliderMoved(JoyStickState(arg.state, iJoyStick), id);
+    if (sliderStates_[iJoyStick].sliderStates[id].x != arg.state.mSliders[id].abX)
+    {
+      // slider X axis changed
+      sliderStates_[iJoyStick].sliderStates[id].x = arg.state.mSliders[id].abX;
+      for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
+        activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickAxisMoved(iJoyStick, id * 2, arg.state.mSliders[id].abX);
+    }
+    else if (sliderStates_[iJoyStick].sliderStates[id].y != arg.state.mSliders[id].abY)
+    {
+      // slider Y axis changed
+      sliderStates_[iJoyStick].sliderStates[id].y = arg.state.mSliders[id].abY;
+      for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
+        activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickAxisMoved(iJoyStick, id * 2 + 1, arg.state.mSliders[id].abY);
+    }
 
     return true;
@@ -650,11 +692,30 @@
       iJoyStick++;
 
-    for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++)
-      activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickPovMoved(JoyStickState(arg.state, iJoyStick), id);
-
-    return true;
-  }
-
-  bool InputManager::vector3Moved(const OIS::JoyStickEvent &arg, int id)
+    // translate the POV into 8 simple buttons
+    int lastState = povStates_[iJoyStick][id];
+    if (lastState & OIS::Pov::North)
+      buttonReleased(arg, 32 + id * 4 + 0);
+    if (lastState & OIS::Pov::South)
+      buttonReleased(arg, 32 + id * 4 + 1);
+    if (lastState & OIS::Pov::East)
+      buttonReleased(arg, 32 + id * 4 + 2);
+    if (lastState & OIS::Pov::West)
+      buttonReleased(arg, 32 + id * 4 + 3);
+    
+    povStates_[iJoyStick].povStates[id] = arg.state.mPOV[id].direction;
+    int currentState = povStates_[iJoyStick][id];
+    if (currentState & OIS::Pov::North)
+      buttonPressed(arg, 32 + id * 4 + 0);
+    if (currentState & OIS::Pov::South)
+      buttonPressed(arg, 32 + id * 4 + 1);
+    if (currentState & OIS::Pov::East)
+      buttonPressed(arg, 32 + id * 4 + 2);
+    if (currentState & OIS::Pov::West)
+      buttonPressed(arg, 32 + id * 4 + 3);
+
+    return true;
+  }
+
+  /*bool InputManager::vector3Moved(const OIS::JoyStickEvent &arg, int id)
   {
     // use the device to identify which one called the method
@@ -668,5 +729,5 @@
 
     return true;
-  }
+  }*/
 
 
@@ -735,5 +796,5 @@
   }
 
-  const MouseState InputManager::getMouseState()
+  /*const MouseState InputManager::getMouseState()
   {
     if (_getSingleton().mouse_)
@@ -741,7 +802,7 @@
     else
       return MouseState();
-  }
-
-  const JoyStickState InputManager::getJoyStickState(unsigned int ID)
+  }*/
+
+  /*const JoyStickState InputManager::getJoyStickState(unsigned int ID)
   {
     if (ID < _getSingleton().joySticksSize_)
@@ -749,5 +810,5 @@
     else
       return JoyStickState();
-  }
+  }*/
 
 
@@ -882,5 +943,4 @@
       if ((*it) == (*mapIt).second)
       {
-        _getSingleton().stateRequest_ = IS_CUSTOM;
         return true;
       }
@@ -888,4 +948,5 @@
     _getSingleton().activeKeyHandlers_.push_back((*mapIt).second);
     _getSingleton().stateRequest_ = IS_CUSTOM;
+    _getSingleton()._updateTickables();
     return true;
   }
@@ -910,8 +971,8 @@
         _getSingleton().activeKeyHandlers_.erase(it);
         _getSingleton().stateRequest_ = IS_CUSTOM;
+        _getSingleton()._updateTickables();
         return true;
       }
     }
-    _getSingleton().stateRequest_ = IS_CUSTOM;
     return true;
   }
@@ -1010,5 +1071,4 @@
       if ((*it) == (*mapIt).second)
       {
-        _getSingleton().stateRequest_ = IS_CUSTOM;
         return true;
       }
@@ -1016,4 +1076,5 @@
     _getSingleton().activeMouseHandlers_.push_back((*mapIt).second);
     _getSingleton().stateRequest_ = IS_CUSTOM;
+    _getSingleton()._updateTickables();
     return true;
   }
@@ -1038,8 +1099,8 @@
         _getSingleton().activeMouseHandlers_.erase(it);
         _getSingleton().stateRequest_ = IS_CUSTOM;
+        _getSingleton()._updateTickables();
         return true;
       }
     }
-    _getSingleton().stateRequest_ = IS_CUSTOM;
     return true;
   }
@@ -1147,5 +1208,4 @@
       if ((*it) == (*handlerIt).second)
       {
-        _getSingleton().stateRequest_ = IS_CUSTOM;
         return true;
       }
@@ -1153,4 +1213,5 @@
     _getSingleton().activeJoyStickHandlers_[ID].push_back((*handlerIt).second);
     _getSingleton().stateRequest_ = IS_CUSTOM;
+    _getSingleton()._updateTickables();
     return true;
   }
@@ -1180,4 +1241,5 @@
         _getSingleton().activeJoyStickHandlers_[ID].erase(it);
         _getSingleton().stateRequest_ = IS_CUSTOM;
+        _getSingleton()._updateTickables();
         return true;
       }
Index: /code/trunk/src/core/InputManager.h
===================================================================
--- /code/trunk/src/core/InputManager.h	(revision 1348)
+++ /code/trunk/src/core/InputManager.h	(revision 1349)
@@ -42,4 +42,5 @@
 
 #include "ois/OIS.h"
+#include "util/Math.h"
 #include "Tickable.h"
 #include "InputInterfaces.h"
@@ -47,4 +48,23 @@
 namespace orxonox
 {
+  /**
+  * Helper class to realise a vector<int[4]>
+  */
+  class POVStates
+  {
+  public:
+    int operator[](unsigned int index) { return povStates[index]; }
+    int povStates[4];
+  };
+
+  /**
+  * Helper class to realise a vector< {int[4], int[4]} >
+  */
+  class SliderStates
+  {
+  public:
+    IntVector2 sliderStates[4];
+  };
+
   /**
     @brief Captures and distributes mouse and keyboard input.
@@ -85,6 +105,6 @@
     static bool isModifierDown(KeyboardModifier::Enum modifier);
     static bool isKeyDown(KeyCode::Enum key);
-    static const MouseState getMouseState();
-    static const JoyStickState getJoyStickState(unsigned int ID);
+    //static const MouseState getMouseState();
+    //static const JoyStickState getJoyStickState(unsigned int ID);
 
     static void setWindowExtents(const int width, const int height);
@@ -130,4 +150,6 @@
     void _destroyMouse();
     void _destroyJoySticks();
+
+    void _updateTickables();
 
     void tick(float dt);
@@ -144,5 +166,5 @@
     bool sliderMoved   (const OIS::JoyStickEvent &arg, int id);
     bool povMoved      (const OIS::JoyStickEvent &arg, int id);
-    bool vector3Moved  (const OIS::JoyStickEvent &arg, int id);
+    //bool vector3Moved  (const OIS::JoyStickEvent &arg, int id);
 
     static InputManager& _getSingleton();
@@ -160,4 +182,9 @@
     unsigned int keyboardModifiers_;
 
+    //! Keeps track of the joy stick POV states
+    std::vector<POVStates>                      povStates_;
+    //! Keeps track of the possibly two slider axes
+    std::vector<SliderStates>                   sliderStates_;
+
     std::map<std::string, KeyHandler*>          keyHandlers_;
     std::map<std::string, MouseHandler*>        mouseHandlers_;
@@ -167,4 +194,5 @@
     std::vector<MouseHandler*>                  activeMouseHandlers_;
     std::vector<std::vector<JoyStickHandler*> > activeJoyStickHandlers_;
+    std::vector<InputTickable*>                 activeHandlers_;
 
     std::vector<Key>                            keysDown_;
Index: /code/trunk/src/core/SignalHandler.cc
===================================================================
--- /code/trunk/src/core/SignalHandler.cc	(revision 1348)
+++ /code/trunk/src/core/SignalHandler.cc	(revision 1349)
@@ -150,9 +150,9 @@
   {
     std::cout << "Trying to restore XAutoKeyRepeat" << std::endl;
-	Display* display;
-	  if ((display = XOpenDisplay(0)))
-    {
-			XAutoRepeatOn(display);
-		  XCloseDisplay(display);
+    Display* display;
+    if ((display = XOpenDisplay(0)))
+    {
+      XAutoRepeatOn(display);
+      XCloseDisplay(display);
     }
   }
@@ -320,7 +320,7 @@
 
   std::string timeString = "\n\n\n\n"
-	                   "=======================================================\n"
-	                   "= time: " + std::string(ctime(&now)) +
-			   "=======================================================\n";
+                     "=======================================================\n"
+                     "= time: " + std::string(ctime(&now)) +
+         "=======================================================\n";
   bt.insert(0, timeString);
 
Index: /code/trunk/src/ois/OISJoyStick.cpp
===================================================================
--- /code/trunk/src/ois/OISJoyStick.cpp	(revision 1348)
+++ /code/trunk/src/ois/OISJoyStick.cpp	(revision 1349)
@@ -36,5 +36,5 @@
 
 //----------------------------------------------------------------------------//
-int JoyStick::getNumberOfComponents(ComponentType cType)
+int JoyStick::getNumberOfComponents(ComponentType cType) const
 {
 	switch( cType )
@@ -56,5 +56,5 @@
 
 //----------------------------------------------------------------------------//
-float JoyStick::getVector3Sensitivity()
+float JoyStick::getVector3Sensitivity() const
 {
 	return mVector3Sensitivity;
@@ -68,5 +68,5 @@
 
 //----------------------------------------------------------------------------//
-JoyStickListener* JoyStick::getEventCallback()
+JoyStickListener* JoyStick::getEventCallback() const
 {
 	return mListener;
Index: /code/trunk/src/ois/OISJoyStick.h
===================================================================
--- /code/trunk/src/ois/OISJoyStick.h	(revision 1348)
+++ /code/trunk/src/ois/OISJoyStick.h	(revision 1349)
@@ -168,5 +168,5 @@
 			The ComponentType you are interested in knowing about
 		*/
-		int getNumberOfComponents(ComponentType cType);
+		int getNumberOfComponents(ComponentType cType) const;
 
 		/**
@@ -184,5 +184,5 @@
 			Returns the sensitivity cutoff for Vector3 Component
 		*/
-		float getVector3Sensitivity();
+		float getVector3Sensitivity() const;
 
 		/**
@@ -196,5 +196,5 @@
 
 		/** @remarks Returns currently set callback.. or null */
-		JoyStickListener* getEventCallback();
+		JoyStickListener* getEventCallback() const;
 
 		/** @remarks Returns the state of the joystick - is valid for both buffered and non buffered mode */
Index: /code/trunk/src/ois/OISKeyboard.cpp
===================================================================
--- /code/trunk/src/ois/OISKeyboard.cpp	(revision 1348)
+++ /code/trunk/src/ois/OISKeyboard.cpp	(revision 1349)
@@ -33,5 +33,5 @@
 
 //----------------------------------------------------------------------//
-bool Keyboard::isModifierDown( Modifier mod )
+bool Keyboard::isModifierDown( Modifier mod ) const
 {
 #if defined(OIS_MSVC_COMPILER)
Index: /code/trunk/src/ois/OISKeyboard.h
===================================================================
--- /code/trunk/src/ois/OISKeyboard.h	(revision 1348)
+++ /code/trunk/src/ois/OISKeyboard.h	(revision 1349)
@@ -220,5 +220,5 @@
 			A KeyCode to check
 		*/
-		virtual bool isKeyDown( KeyCode key ) = 0;
+		virtual bool isKeyDown( KeyCode key ) const = 0;
 
 		/**
@@ -235,5 +235,5 @@
 			Returns currently set callback.. or 0
 		*/
-		KeyListener* getEventCallback() {return mListener;}
+		KeyListener* getEventCallback() const {return mListener;}
 
 		//! TextTranslation Mode
@@ -260,5 +260,5 @@
 			Returns current translation mode
 		*/
-		TextTranslationMode getTextTranslation(){return mTextMode;}
+		TextTranslationMode getTextTranslation() const {return mTextMode;}
 		
 		/**
@@ -286,5 +286,5 @@
 			Check modifier status
 		*/
-		bool isModifierDown( Modifier mod );
+		bool isModifierDown( Modifier mod ) const;
 
 		/**
@@ -293,5 +293,5 @@
 			(in the form of 1 is down and 0 is up)
 		*/
-		virtual void copyKeyStates( char keys[256] ) = 0;
+		virtual void copyKeyStates( char keys[256] ) const = 0;
 		
 	protected:
Index: /code/trunk/src/ois/OISMouse.h
===================================================================
--- /code/trunk/src/ois/OISMouse.h	(revision 1348)
+++ /code/trunk/src/ois/OISMouse.h	(revision 1349)
@@ -120,5 +120,5 @@
 
 		/** @remarks Returns currently set callback.. or 0 */
-		MouseListener* getEventCallback() {return mListener;}
+		MouseListener* getEventCallback() const {return mListener;}
 
 		/** @remarks Returns the state of the mouse - is valid for both buffered and non buffered mode */
Index: /code/trunk/src/ois/OISObject.h
===================================================================
--- /code/trunk/src/ois/OISObject.h	(revision 1348)
+++ /code/trunk/src/ois/OISObject.h	(revision 1349)
@@ -45,5 +45,5 @@
 
 		/** @remarks Returns this input object's creator */
-		InputManager* getCreator() { return mCreator; }
+		InputManager* getCreator() const { return mCreator; }
 
 		/** @remarks Sets buffered mode	*/
Index: /code/trunk/src/ois/linux/LinuxKeyboard.cpp
===================================================================
--- /code/trunk/src/ois/linux/LinuxKeyboard.cpp	(revision 1348)
+++ /code/trunk/src/ois/linux/LinuxKeyboard.cpp	(revision 1349)
@@ -290,5 +290,5 @@
 
 //-------------------------------------------------------------------//
-bool LinuxKeyboard::isKeyDown( KeyCode key )
+bool LinuxKeyboard::isKeyDown( KeyCode key ) const
 {
 	return (KeyBuffer[key]);
@@ -449,5 +449,5 @@
 
 //-------------------------------------------------------------------//
-void LinuxKeyboard::copyKeyStates( char keys[256] )
+void LinuxKeyboard::copyKeyStates( char keys[256] ) const
 {
 	memcpy( keys, KeyBuffer, 256 );
Index: /code/trunk/src/ois/linux/LinuxKeyboard.h
===================================================================
--- /code/trunk/src/ois/linux/LinuxKeyboard.h	(revision 1348)
+++ /code/trunk/src/ois/linux/LinuxKeyboard.h	(revision 1349)
@@ -38,5 +38,5 @@
 
 		/** @copydoc Keyboard::isKeyDown */
-		virtual bool isKeyDown( KeyCode key );
+		virtual bool isKeyDown( KeyCode key ) const;
 
 		/** @copydoc Keyboard::getAsString */
@@ -44,5 +44,5 @@
 
 		/** @copydoc Keyboard::copyKeyStates */
-		virtual void copyKeyStates( char keys[256] );
+		virtual void copyKeyStates( char keys[256] ) const;
 
 		/** @copydoc Object::setBuffered */
Index: /code/trunk/src/ois/mac/MacKeyboard.cpp
===================================================================
--- /code/trunk/src/ois/mac/MacKeyboard.cpp	(revision 1348)
+++ /code/trunk/src/ois/mac/MacKeyboard.cpp	(revision 1349)
@@ -130,5 +130,5 @@
 
 //-------------------------------------------------------------------//
-bool MacKeyboard::isKeyDown( KeyCode key )
+bool MacKeyboard::isKeyDown( KeyCode key ) const
 {
 	return (bool)KeyBuffer[key];
@@ -321,5 +321,5 @@
 
 //-------------------------------------------------------------------//
-void MacKeyboard::copyKeyStates( char keys[256] )
+void MacKeyboard::copyKeyStates( char keys[256] ) const
 {
 	memcpy( keys, KeyBuffer, 256 );
Index: /code/trunk/src/ois/mac/MacKeyboard.h
===================================================================
--- /code/trunk/src/ois/mac/MacKeyboard.h	(revision 1348)
+++ /code/trunk/src/ois/mac/MacKeyboard.h	(revision 1349)
@@ -43,5 +43,5 @@
         
         // unbuffered keydown check
-        virtual bool isKeyDown( KeyCode key );
+        virtual bool isKeyDown( KeyCode key ) const;
         
         // This will send listener events if buffered is on.
@@ -51,5 +51,5 @@
         
         // Copies the current key buffer
-        virtual void copyKeyStates( char keys[256] );
+        virtual void copyKeyStates( char keys[256] ) const;
         
         // Returns a description of the given key
Index: /code/trunk/src/ois/win32/Win32JoyStick.cpp
===================================================================
--- /code/trunk/src/ois/win32/Win32JoyStick.cpp	(revision 1348)
+++ /code/trunk/src/ois/win32/Win32JoyStick.cpp	(revision 1349)
@@ -149,6 +149,6 @@
 	diptr.diph.dwHow        = DIPH_BYID;
 	diptr.diph.dwObj        = lpddoi->dwType;
-	//Add the high bit in so that an axis value of zero does not mean a null userdata
-	diptr.uData             = 0x80000000 | _this->_AxisNumber;
+	//Add a magic number to recognise we set seomthing
+	diptr.uData             = 0x13130000 | _this->_AxisNumber;
 
 	//Check if axis is slider, if so, do not treat as regular axis
@@ -166,5 +166,6 @@
 
 	//Increase for next time through
-	_this->_AxisNumber += 1;
+	if(GUID_Slider != lpddoi->guidType)
+		_this->_AxisNumber += 1;
 
 	//Set range
@@ -238,79 +239,80 @@
 	for(unsigned int i = 0; i < entries; ++i)
 	{
-		//First check to see if event entry is a Axis we enumerated earlier
-		if( diBuff[i].uAppData != 0xFFFFFFFF && diBuff[i].uAppData > 0 )
+		//This may seem outof order, but is in order of the way these variables
+		//are declared in the JoyStick State 2 structure.
+		switch(diBuff[i].dwOfs)
 		{
-			int axis = (int)(0x7FFFFFFF & diBuff[i].uAppData); //Mask out the high bit
-			assert( axis >= 0 && axis < (int)mState.mAxes.size() && "Axis out of range!");
-			mState.mAxes[axis].abs = diBuff[i].dwData;
-			axisMoved[axis] = true;
-		}
-		else
-		{
-			//This may seem outof order, but is in order of the way these variables
-			//are declared in the JoyStick State 2 structure.
-			switch(diBuff[i].dwOfs)
+		//------ slider -//
+		case DIJOFS_SLIDER0(0):
+			sliderMoved[0] = true;
+			mState.mSliders[0].abX = diBuff[i].dwData;
+			break;
+		case DIJOFS_SLIDER0(1):
+			sliderMoved[0] = true;
+			mState.mSliders[0].abY = diBuff[i].dwData;
+			break;
+		//----- Max 4 POVs Next ---------------//
+		case DIJOFS_POV(0):
+			if(!_changePOV(0,diBuff[i]))
+				return;
+			break;
+		case DIJOFS_POV(1):
+			if(!_changePOV(1,diBuff[i]))
+				return;
+			break;
+		case DIJOFS_POV(2):
+			if(!_changePOV(2,diBuff[i]))
+				return;
+			break;
+		case DIJOFS_POV(3):
+			if(!_changePOV(3,diBuff[i]))
+				return;
+			break;
+		case DIJOFS_SLIDER1(0):
+			sliderMoved[1] = true;
+			mState.mSliders[1].abX = diBuff[i].dwData;
+			break;
+		case DIJOFS_SLIDER1(1):
+			sliderMoved[1] = true;
+			mState.mSliders[1].abY = diBuff[i].dwData;
+			break;
+		case DIJOFS_SLIDER2(0):
+			sliderMoved[2] = true;
+			mState.mSliders[2].abX = diBuff[i].dwData;
+			break;
+		case DIJOFS_SLIDER2(1):
+			sliderMoved[2] = true;
+			mState.mSliders[2].abY = diBuff[i].dwData;
+			break;
+		case DIJOFS_SLIDER3(0):
+			sliderMoved[3] = true;
+			mState.mSliders[3].abX = diBuff[i].dwData;
+			break;
+		case DIJOFS_SLIDER3(1):
+			sliderMoved[3] = true;
+			mState.mSliders[3].abY = diBuff[i].dwData;
+			break;
+		//-----------------------------------------//
+		default:
+			//Handle Button Events Easily using the DX Offset Macros
+			if( diBuff[i].dwOfs >= DIJOFS_BUTTON(0) && diBuff[i].dwOfs < DIJOFS_BUTTON(128) )
 			{
-			//------ slider -//
-			case DIJOFS_SLIDER0(0):
-				sliderMoved[0] = true;
-				mState.mSliders[0].abX = diBuff[i].dwData;
-				break;
-			case DIJOFS_SLIDER0(1):
-				sliderMoved[0] = true;
-				mState.mSliders[0].abY = diBuff[i].dwData;
-				break;
-			//----- Max 4 POVs Next ---------------//
-			case DIJOFS_POV(0):
-				if(!_changePOV(0,diBuff[i]))
+				if(!_doButtonClick((diBuff[i].dwOfs - DIJOFS_BUTTON(0)), diBuff[i]))
 					return;
-				break;
-			case DIJOFS_POV(1):
-				if(!_changePOV(1,diBuff[i]))
-					return;
-				break;
-			case DIJOFS_POV(2):
-				if(!_changePOV(2,diBuff[i]))
-					return;
-				break;
-			case DIJOFS_POV(3):
-				if(!_changePOV(3,diBuff[i]))
-					return;
-				break;
-			case DIJOFS_SLIDER1(0):
-				sliderMoved[1] = true;
-				mState.mSliders[1].abX = diBuff[i].dwData;
-				break;
-			case DIJOFS_SLIDER1(1):
-				sliderMoved[1] = true;
-				mState.mSliders[1].abY = diBuff[i].dwData;
-				break;
-			case DIJOFS_SLIDER2(0):
-				sliderMoved[2] = true;
-				mState.mSliders[2].abX = diBuff[i].dwData;
-				break;
-			case DIJOFS_SLIDER2(1):
-				sliderMoved[2] = true;
-				mState.mSliders[2].abY = diBuff[i].dwData;
-				break;
-			case DIJOFS_SLIDER3(0):
-				sliderMoved[3] = true;
-				mState.mSliders[3].abX = diBuff[i].dwData;
-				break;
-			case DIJOFS_SLIDER3(1):
-				sliderMoved[3] = true;
-				mState.mSliders[3].abY = diBuff[i].dwData;
-				break;
-			//-----------------------------------------//
-			default:
-				//Handle Button Events Easily using the DX Offset Macros
-				if( diBuff[i].dwOfs >= DIJOFS_BUTTON(0) && diBuff[i].dwOfs < DIJOFS_BUTTON(128) )
+			}
+			else if((short)(diBuff[i].uAppData >> 16) == 0x1313)
+			{	//If it was nothing else, might be axis enumerated earlier (determined by magic number)
+				int axis = (int)(0x0000FFFF & diBuff[i].uAppData); //Mask out the high bit
+				assert( axis >= 0 && axis < (int)mState.mAxes.size() && "Axis out of range!");
+
+				if(axis >= 0 && axis < (int)mState.mAxes.size())
 				{
-					if(!_doButtonClick((diBuff[i].dwOfs - DIJOFS_BUTTON(0)), diBuff[i]))
-						return;
+					mState.mAxes[axis].abs = diBuff[i].dwData;
+					axisMoved[axis] = true;
 				}
-				break;
-			} //end case
-		} //End else
+			}
+
+			break;
+		} //end case
 	} //end for
 
Index: /code/trunk/src/ois/win32/Win32KeyBoard.cpp
===================================================================
--- /code/trunk/src/ois/win32/Win32KeyBoard.cpp	(revision 1348)
+++ /code/trunk/src/ois/win32/Win32KeyBoard.cpp	(revision 1349)
@@ -105,4 +105,6 @@
 	DWORD entries = KEYBOARD_DX_BUFFERSIZE;
 	HRESULT hr;
+	//Only one keyboard allowed per app, so static is ok
+	static bool verifyAfterAltTab = false;
 
 	hr = mKeyboard->GetDeviceData( sizeof(DIDEVICEOBJECTDATA), diBuff, &entries, 0 );
@@ -110,6 +112,10 @@
 	{
 		hr = mKeyboard->Acquire();
+		if (hr == E_ACCESSDENIED)
+			verifyAfterAltTab = true;
+
 		while( hr == DIERR_INPUTLOST )
 			hr = mKeyboard->Acquire();
+
 		return;
 	}
@@ -121,5 +127,5 @@
 	for(unsigned int i = 0; i < entries; ++i )
 	{
-		//If the mListener returns false, that means that we are probably deleted...
+		//If the listener returns false, that means that we are probably deleted...
 		//send no more events and just leave as the this pointer is invalid now...
 		bool ret = true;
@@ -159,4 +165,37 @@
 		if(ret == false)
 			break;
+	}
+
+	// If a lost device/access denied was detected, recover gracefully with new events
+	if(verifyAfterAltTab)
+	{
+		bool ret = true;
+		
+		//Copy old buffer to temp location to compare against
+		unsigned char keyBufferCopy[256];
+		memcpy(keyBufferCopy, KeyBuffer, 256);
+
+		//Update new state
+		_read();
+
+		for (unsigned i = 0; i < 256; i++)
+		{
+			if (keyBufferCopy[i] != KeyBuffer[i])
+			{
+				if (mListener)
+				{
+					if (KeyBuffer[i])
+						ret = mListener->keyPressed( KeyEvent( this, (KeyCode)i, _translateText((KeyCode)i) ) );
+					else
+						ret = mListener->keyReleased( KeyEvent( this, (KeyCode)i, 0 ) );
+				}
+			}
+
+			//If user returned false from callback, return immediately
+			if(ret == false)
+				return;
+		}
+
+		verifyAfterAltTab = false;
 	}
 }
@@ -243,5 +282,5 @@
 
 //--------------------------------------------------------------------------------------------------//
-bool Win32Keyboard::isKeyDown( KeyCode key )
+bool Win32Keyboard::isKeyDown( KeyCode key ) const
 {
 	return (KeyBuffer[key] & 0x80) != 0;
@@ -272,5 +311,5 @@
 
 //--------------------------------------------------------------------------------------------------//
-void Win32Keyboard::copyKeyStates( char keys[256] )
+void Win32Keyboard::copyKeyStates( char keys[256] ) const
 {
 	for(int i = 0; i < 256; ++i)
Index: /code/trunk/src/ois/win32/Win32KeyBoard.h
===================================================================
--- /code/trunk/src/ois/win32/Win32KeyBoard.h	(revision 1348)
+++ /code/trunk/src/ois/win32/Win32KeyBoard.h	(revision 1349)
@@ -46,5 +46,5 @@
 
 		/** @copydoc Keyboard::isKeyDown */
-		virtual bool isKeyDown( KeyCode key );
+		virtual bool isKeyDown( KeyCode key ) const;
 		
 		/** @copydoc Keyboard::getAsString */
@@ -52,5 +52,5 @@
 
 		/** @copydoc Keyboard::copyKeyStates */
-		virtual void copyKeyStates( char keys[256] );
+		virtual void copyKeyStates( char keys[256] ) const;
 
 		/** @copydoc Object::setBuffered */
Index: /code/trunk/src/orxonox/GraphicsEngine.cc
===================================================================
--- /code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1348)
+++ /code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1349)
@@ -9,6 +9,6 @@
  *   modify it under the terms of the GNU General Public License
  *   as published by the Free Software Foundation; either version 2
- *   of the License, or (atl your option) any later version.
- *lo
+ *   of the License, or (at your option) any later version.
+ *
  *   This program is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Index: /code/trunk/src/orxonox/Orxonox.cc
===================================================================
--- /code/trunk/src/orxonox/Orxonox.cc	(revision 1348)
+++ /code/trunk/src/orxonox/Orxonox.cc	(revision 1349)
@@ -83,6 +83,7 @@
 namespace orxonox
 {
-  ConsoleCommandShortcut(Orxonox, exit, AccessLevel::None);
-  ConsoleCommandShortcut(Orxonox, slomo, AccessLevel::Offline).setDefaultValue(0, 1.0);
+  ConsoleCommandShortcut(Orxonox, exit, AccessLevel::None).setKeybindMode(KeybindMode::OnPress);
+  ConsoleCommandShortcut(Orxonox, slomo, AccessLevel::Offline).setDefaultValue(0, 1.0)
+    .setAxisParamIndex(0).setIsAxisRelative(false);
   ConsoleCommandShortcut(Orxonox, setTimeFactor, AccessLevel::Offline).setDefaultValue(0, 1.0);
   ConsoleCommandShortcut(Orxonox, activateConsole, AccessLevel::None);
Index: /code/trunk/src/orxonox/objects/SpaceShip.cc
===================================================================
--- /code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1348)
+++ /code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1349)
@@ -38,7 +38,5 @@
 
 #include "CameraHandler.h"
-#include "tinyxml/tinyxml.h"
-#include "ois/OIS.h"
-#include "util/Convert.h"
+//#include "util/Convert.h"
 #include "util/Math.h"
 #include "core/CoreIncludes.h"
@@ -219,57 +217,4 @@
     }
 
-    void SpaceShip::loadParams(TiXmlElement* xmlElem)
-    {
-        Model::loadParams(xmlElem);
-        this->create();
-        this->getFocus();
-/*
-        if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft"))
-        {
-            std::string forwardStr = xmlElem->Attribute("forward");
-            std::string rotateupdownStr = xmlElem->Attribute("rotateupdown");
-            std::string rotaterightleftStr = xmlElem->Attribute("rotaterightleft");
-            std::string looprightleftStr = xmlElem->Attribute("looprightleft");
-
-            String2Number<float>(this->maxSpeedForward_, forwardStr);
-            String2Number<float>(this->maxSpeedRotateUpDown_, rotateupdownStr);
-            String2Number<float>(this->maxSpeedRotateRightLeft_, rotaterightleftStr);
-            String2Number<float>(this->maxSpeedLoopRightLeft_, looprightleftStr);
-
-            COUT(4) << "Loader: Initialized spaceship steering with values " << maxSpeedForward_ << " " << maxSpeedRotateUpDown_ << " " << maxSpeedRotateRightLeft_ << " " << maxSpeedLoopRightLeft_ << " " << std::endl;
-      }
-*/
-        if (xmlElem->Attribute("maxSpeed") && xmlElem->Attribute("maxSideAndBackSpeed") && xmlElem->Attribute("maxRotation") && xmlElem->Attribute("transAcc") && xmlElem->Attribute("rotAcc") && xmlElem->Attribute("transDamp") && xmlElem->Attribute("rotDamp"))
-        {
-
-            std::string msStr = xmlElem->Attribute("maxSpeed");
-            std::string msabsStr = xmlElem->Attribute("maxSideAndBackSpeed");
-            std::string mrStr = xmlElem->Attribute("maxRotation");
-            std::string taStr = xmlElem->Attribute("transAcc");
-            std::string raStr = xmlElem->Attribute("rotAcc");
-            std::string tdStr = xmlElem->Attribute("transDamp");
-            std::string rdStr = xmlElem->Attribute("rotDamp");
-
-            convertValue<std::string, float>(&this->maxSpeed_, msStr);
-            convertValue<std::string, float>(&this->maxSideAndBackSpeed_, msabsStr);
-            convertValue<std::string, float>(&this->maxRotation_, mrStr);
-            convertValue<std::string, float>(&this->translationAcceleration_, taStr);
-            convertValue<std::string, float>(&this->rotationAcceleration_, raStr);
-            convertValue<std::string, float>(&this->translationDamping_, tdStr);
-            convertValue<std::string, float>(&this->rotationDamping_, rdStr);
-
-            this->maxRotationRadian_ = Radian(this->maxRotation_);
-            this->rotationAccelerationRadian_ = Radian(this->rotationAcceleration_);
-            this->rotationDampingRadian_ = Radian(this->rotationDamping_);
-
-            COUT(4) << "Loader: Initialized SpaceShip" << std::endl;
-        }
-
-        if (xmlElem->Attribute("camera"))
-        {
-            this->setCamera();
-        }
-    }
-
     void SpaceShip::setCamera(const std::string& camera)
     {
@@ -351,5 +296,5 @@
     }
 
-    bool SpaceShip::mouseMoved(const MouseState& state)
+    void SpaceShip::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
     {
 /*
@@ -368,14 +313,14 @@
         if (this->bRMousePressed_)
         {
-            this->camNode_->roll(Degree(-state.X.rel * 0.10));
-            this->camNode_->yaw(Degree(state.Y.rel * 0.10));
+            this->camNode_->roll(Degree(-rel.x * 0.10));
+            this->camNode_->yaw(Degree(rel.y * 0.10));
         }
         else
         {
-            float minDimension = state.height;
-            if (state.width < minDimension)
-                minDimension = state.width;
-
-            this->mouseX_ += state.X.rel;
+            float minDimension = clippingSize.y;
+            if (clippingSize.x < minDimension)
+                minDimension = clippingSize.x;
+
+            this->mouseX_ += rel.x;
             if (this->mouseX_ < -minDimension)
                 this->mouseX_ = -minDimension;
@@ -383,5 +328,5 @@
                 this->mouseX_ = minDimension;
 
-            this->mouseY_ += state.Y.rel;
+            this->mouseY_ += rel.y;
             if (this->mouseY_ < -minDimension)
                 this->mouseY_ = -minDimension;
@@ -407,9 +352,7 @@
             this->mouseYRotation_ = Radian(yRotation);
         }
-
-        return true;
-    }
-
-    bool SpaceShip::mouseButtonPressed(const MouseState& state, MouseButton::Enum id)
+    }
+
+    void SpaceShip::mouseButtonPressed(MouseButton::Enum id)
     {
         if (id == MouseButton::Left)
@@ -417,9 +360,7 @@
         else if (id == MouseButton::Right)
             this->bRMousePressed_ = true;
-
-        return true;
-    }
-
-    bool SpaceShip::mouseButtonReleased(const MouseState& state, MouseButton::Enum id)
+    }
+
+    void SpaceShip::mouseButtonReleased(MouseButton::Enum id)
     {
         if (id == MouseButton::Left)
@@ -430,6 +371,4 @@
             this->camNode_->resetOrientation();
         }
-
-        return true;
     }
 
@@ -564,227 +503,5 @@
         else
             this->tt_->setRate(0);
-
-/*
-        if (mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W))
-            this->moveForward(speed);
-        else
-            this->moveForward(0);
-
-        if(mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S))
-            this->brakeForward(speed);
-        else
-            this->brakeForward(speed/10);
-
-        if (mKeyboard->isKeyDown(OIS::KC_RIGHT) || mKeyboard->isKeyDown(OIS::KC_D))
-            this->loopRight(loop);
-        else
-            this->loopRight(0);
-
-        if (mKeyboard->isKeyDown(OIS::KC_LEFT) || mKeyboard->isKeyDown(OIS::KC_A))
-            this->loopLeft(loop);
-        else
-            this->loopLeft(0);
-
-        if(moved)
-        {
-            if (mouseY<=0)
-                this->rotateUp(-mouseY*rotate);
-            if (mouseY>0)
-                this->rotateDown(mouseY*rotate);
-            if (mouseX>0)
-                this->rotateRight(mouseX*rotate);
-            if (mouseX<=0)
-                this->rotateLeft(-mouseX*rotate);
-
-            mouseY = 0;
-            mouseX = 0;
-            moved = false;
-        }*/
-/*        else
-        {
-            this->rotateUp(0);
-            this->rotateDown(0);
-            this->rotateRight(0);
-            this->rotateLeft(0);
-        }*/
-/*
-        if(moveForward_ > 0)
-        {
-            accelerationForward_ = moveForward_;
-            if(speedForward_ < maxSpeedForward_)
-                speedForward_ += accelerationForward_*dt;
-            if(speedForward_ > maxSpeedForward_)
-                speedForward_ = maxSpeedForward_;
-        }
-
-        if(moveForward_ <= 0)
-        {
-            accelerationForward_ = -brakeForward_;
-            if(speedForward_ > 0)
-                speedForward_ += accelerationForward_*dt;
-            if(speedForward_ < 0)
-                speedForward_ = 0;
-        }
-
-        if(rotateUp_ > 0)
-        {
-            accelerationRotateUpDown_ = rotateUp_;
-            if(speedRotateUpDown_ < maxSpeedRotateUpDown_)
-                speedRotateUpDown_ += accelerationRotateUpDown_*dt;
-            if(speedRotateUpDown_ > maxSpeedRotateUpDown_)
-            speedRotateUpDown_ = maxSpeedRotateUpDown_;
-        }
-
-        if(rotateDown_ > 0)
-        {
-            accelerationRotateUpDown_ = rotateDown_;
-            if(speedRotateUpDown_ > -maxSpeedRotateUpDown_)
-                speedRotateUpDown_ -= accelerationRotateUpDown_*dt;
-            if(speedRotateUpDown_ < -maxSpeedRotateUpDown_)
-                speedRotateUpDown_ = -maxSpeedRotateUpDown_;
-        }
-
-        if(rotateUp_ == 0 && rotateDown_ == 0)
-        {
-            accelerationRotateUpDown_ = brakeRotate_;
-            if(speedRotateUpDown_ > 0)
-                speedRotateUpDown_ -= accelerationRotateUpDown_*dt;
-            if(speedRotateUpDown_ < 0)
-                speedRotateUpDown_ += accelerationRotateUpDown_*dt;
-            if(fabs(speedRotateUpDown_) < accelerationRotateUpDown_*dt)
-                speedRotateUpDown_ = 0;
-        }
-
-        if(rotateRight_ > 0)
-        {
-            accelerationRotateRightLeft_ = rotateRight_;
-            if(speedRotateRightLeft_ > -maxSpeedRotateRightLeft_)
-                speedRotateRightLeft_ -= accelerationRotateRightLeft_*dt;
-            if(speedRotateRightLeft_ < -maxSpeedRotateRightLeft_)
-                speedRotateRightLeft_ = -maxSpeedRotateRightLeft_;
-        }
-
-        if(rotateLeft_ > 0)
-        {
-            accelerationRotateRightLeft_ = rotateLeft_;
-            if(speedRotateRightLeft_ < maxSpeedRotateRightLeft_)
-                speedRotateRightLeft_ += accelerationRotateRightLeft_*dt;
-            if(speedRotateRightLeft_ > maxSpeedRotateRightLeft_)
-                speedRotateRightLeft_ = maxSpeedRotateRightLeft_;
-        }
-
-        if(rotateRight_ == 0 && rotateLeft_ == 0)
-        {
-            accelerationRotateRightLeft_ = brakeRotate_;
-            if(speedRotateRightLeft_ > 0)
-                speedRotateRightLeft_ -= accelerationRotateRightLeft_*dt;
-            if(speedRotateRightLeft_ < 0)
-                speedRotateRightLeft_ += accelerationRotateRightLeft_*dt;
-            if(fabs(speedRotateRightLeft_) < accelerationRotateRightLeft_*dt)
-                speedRotateRightLeft_ = 0;
-        }
-
-        if(loopRight_ > 0)
-        {
-            accelerationLoopRightLeft_ = loopRight_;
-            if(speedLoopRightLeft_ < maxSpeedLoopRightLeft_)
-                speedLoopRightLeft_ += accelerationLoopRightLeft_*dt;
-            if(speedLoopRightLeft_ > maxSpeedLoopRightLeft_)
-                speedLoopRightLeft_ = maxSpeedLoopRightLeft_;
-        }
-
-        if(loopLeft_ > 0)
-        {
-            accelerationLoopRightLeft_ = loopLeft_;
-            if(speedLoopRightLeft_ > -maxSpeedLoopRightLeft_)
-                speedLoopRightLeft_ -= accelerationLoopRightLeft_*dt;
-            if(speedLoopRightLeft_ < -maxSpeedLoopRightLeft_)
-                speedLoopRightLeft_ = -maxSpeedLoopRightLeft_;
-        }
-
-        if(loopLeft_ == 0 && loopRight_ == 0)
-        {
-            accelerationLoopRightLeft_ = brakeLoop_;
-            if(speedLoopRightLeft_ > 0)
-                speedLoopRightLeft_ -= accelerationLoopRightLeft_*dt;
-            if(speedLoopRightLeft_ < 0)
-                speedLoopRightLeft_ += accelerationLoopRightLeft_*dt;
-            if(fabs(speedLoopRightLeft_) < accelerationLoopRightLeft_*dt)
-                speedLoopRightLeft_ = 0;
-        }
-
-        Vector3 transVector = Vector3::ZERO;
-*/
-/*
-        transVector.z = 1;
-        this->translate(transVector*speedForward_*dt, Ogre::Node::TS_LOCAL);
-        this->pitch(Degree(speedRotateUpDown_*dt), Ogre::Node::TS_LOCAL);
-        this->yaw(Degree(speedRotateRightLeft_*dt), Ogre::Node::TS_LOCAL);
-        this->roll(Degree(speedLoopRightLeft_*dt), Ogre::Node::TS_LOCAL);
-*/
-/*
-        transVector.x = 1;
-        this->translate(transVector*speedForward_*dt, Ogre::Node::TS_LOCAL);
-        this->yaw(Degree(speedRotateUpDown_*dt), Ogre::Node::TS_LOCAL);
-        this->roll(Degree(speedRotateRightLeft_*dt), Ogre::Node::TS_LOCAL);
-        this->pitch(Degree(speedLoopRightLeft_*dt), Ogre::Node::TS_LOCAL);
-*/
-    }
-/*
-    void SpaceShip::moveForward(float moveForward) {
-        moveForward_ = moveForward;
-    }
-
-    void SpaceShip::rotateUp(float rotateUp) {
-        rotateUp_ = rotateUp;
-    }
-
-    void SpaceShip::rotateDown(float rotateDown) {
-        rotateDown_ = rotateDown;
-    }
-
-    void SpaceShip::rotateLeft(float rotateLeft) {
-        rotateLeft_ = rotateLeft;
-    }
-
-    void SpaceShip::rotateRight(float rotateRight) {
-        rotateRight_ = rotateRight;
-    }
-
-    void SpaceShip::loopLeft(float loopLeft) {
-        loopLeft_ = loopLeft;
-    }
-
-    void SpaceShip::loopRight(float loopRight) {
-        loopRight_ = loopRight;
-    }
-
-    void SpaceShip::brakeForward(float brakeForward) {
-        brakeForward_ = brakeForward;
-    }
-
-    void SpaceShip::brakeRotate(float brakeRotate) {
-        brakeRotate_ = brakeRotate;
-    }
-
-    void SpaceShip::brakeLoop(float brakeLoop) {
-        brakeLoop_ = brakeLoop;
-    }
-
-    void SpaceShip::maxSpeedForward(float maxSpeedForward) {
-        maxSpeedForward_ = maxSpeedForward;
-    }
-
-    void SpaceShip::maxSpeedRotateUpDown(float maxSpeedRotateUpDown) {
-        maxSpeedRotateUpDown_ = maxSpeedRotateUpDown;
-    }
-
-    void SpaceShip::maxSpeedRotateRightLeft(float maxSpeedRotateRightLeft) {
-        maxSpeedRotateRightLeft_ = maxSpeedRotateRightLeft;
-    }
-
-    void SpaceShip::maxSpeedLoopRightLeft(float maxSpeedLoopRightLeft) {
-        maxSpeedLoopRightLeft_ = maxSpeedLoopRightLeft;
-    }
-*/
+    }
+
 }
Index: /code/trunk/src/orxonox/objects/SpaceShip.h
===================================================================
--- /code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1348)
+++ /code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1349)
@@ -50,5 +50,4 @@
             void init();
             void setConfigValues();
-            virtual void loadParams(TiXmlElement* xmlElem);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void tick(float dt);
@@ -68,9 +67,9 @@
                 { SpaceShip::instance_s->setMaxSpeed(value); }
 
-            bool mouseButtonPressed (const MouseState& state, MouseButton::Enum id);
-            bool mouseButtonReleased(const MouseState& state, MouseButton::Enum id);
-            bool mouseButtonHeld    (const MouseState& state, MouseButton::Enum id) { return true; }
-            bool mouseMoved         (const MouseState& state);
-            bool mouseScrolled      (const MouseState& state) { return true; }
+            void mouseButtonPressed (MouseButton::Enum id);
+            void mouseButtonReleased(MouseButton::Enum id);
+            void mouseButtonHeld    (MouseButton::Enum id) { }
+            void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
+            void mouseScrolled      (int abs, int rel) { }
 
 
Index: /code/trunk/src/util/Math.h
===================================================================
--- /code/trunk/src/util/Math.h	(revision 1348)
+++ /code/trunk/src/util/Math.h	(revision 1349)
@@ -147,3 +147,22 @@
 }
 
+class _UtilExport IntVector2
+{
+public:
+  IntVector2() : x(0), y(0) { }
+  IntVector2(int _x, int _y) : x(_x), y(_y) { }
+  int x;
+  int y;
+};
+
+class _UtilExport IntVector3
+{
+public:
+  IntVector3() : x(0), y(0), z(0) { }
+  IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }
+  int x;
+  int y;
+  int z;
+};
+
 #endif /* _Util_Math_H__ */
Index: /code/trunk/src/util/SubString.cc
===================================================================
--- /code/trunk/src/util/SubString.cc	(revision 1348)
+++ /code/trunk/src/util/SubString.cc	(revision 1349)
@@ -67,8 +67,8 @@
 SubString::SubString(const std::string& string,
                      const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                     char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
+                     char escapeChar, bool removeEscapeChar, char safemode_char, bool removeSafemodeChar,
                      char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
 {
-  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
+  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeEscapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
 }
 
Index: /code/trunk/src/util/SubString.h
===================================================================
--- /code/trunk/src/util/SubString.h	(revision 1348)
+++ /code/trunk/src/util/SubString.h	(revision 1349)
@@ -89,5 +89,5 @@
   SubString(const std::string& string,
             const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
-            char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+            char escapeChar ='\\', bool removeEscapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
             char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
   SubString(unsigned int argc, const char** argv);
