[Orxonox-commit 5319] r9982 - code/trunk/src/libraries/core/input

landauf at orxonox.net landauf at orxonox.net
Sat Jan 4 23:48:18 CET 2014


Author: landauf
Date: 2014-01-04 23:48:18 +0100 (Sat, 04 Jan 2014)
New Revision: 9982

Modified:
   code/trunk/src/libraries/core/input/Button.cc
Log:
added option to force the arguments which are defined in the keybindings file (instead of overwriting them with the input device's state)

Modified: code/trunk/src/libraries/core/input/Button.cc
===================================================================
--- code/trunk/src/libraries/core/input/Button.cc	2014-01-04 22:25:18 UTC (rev 9981)
+++ code/trunk/src/libraries/core/input/Button.cc	2014-01-04 22:48:18 UTC (rev 9982)
@@ -128,6 +128,7 @@
                 KeybindMode::Value mode = KeybindMode::None;
                 float paramModifier = 1.0f;
                 std::string commandStr;
+                bool forceArguments = false;
 
                 for (unsigned int iToken = 0; iToken < tokens.size(); ++iToken)
                 {
@@ -141,6 +142,8 @@
                         mode = KeybindMode::OnPressAndRelease;
                     else if (token == "onhold")
                         mode = KeybindMode::OnHold;
+                    else if (token == "forcearguments")
+                        forceArguments = true;
                     else if (token == "buttonthreshold")
                     {
                         // for real axes, we can feed a ButtonThreshold argument
@@ -185,7 +188,7 @@
 
                 // check for param command
                 int paramIndex = eval.getConsoleCommand()->getInputConfiguredParam_();
-                if (paramIndex >= 0)
+                if (paramIndex >= 0 && !forceArguments)
                 {
                     // parameter supported command
                     ParamCommand* cmd = new ParamCommand();




More information about the Orxonox-commit mailing list