Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -391,6 +391,19 @@ QString ControllerScriptingInterface::sanatizeName(const QString& name) { · 390 unmodified lines | ||
| 391 | 391 | |
| 392 | 392 | void ControllerScriptingInterface::wireUpControllers(ScriptEngine* engine) { |
| 393 | 393 | |
| 394 | + // Controller.Standard.* | |
| 395 | + auto standardDevice = DependencyManager::get<UserInputMapper>()->getStandardDevice(); | |
| 396 | + if (standardDevice) { | |
| 397 | + auto deviceName = sanatizeName(standardDevice->getName()); | |
| 398 | + auto deviceInputs = standardDevice->getAvailabeInputs(); | |
| 399 | + for (const auto& inputMapping : deviceInputs) { | |
| 400 | + auto input = inputMapping.first; | |
| 401 | + auto inputName = sanatizeName(inputMapping.second); | |
| 402 | + QString deviceInputName{ "Controller." + deviceName + "." + inputName }; | |
| 403 | + engine->registerValue(deviceInputName, input.getID()); | |
| 404 | + } | |
| 405 | + } | |
| 406 | + | |
| 394 | 407 | // Controller.Hardware.* |
| 395 | 408 | auto devices = DependencyManager::get<UserInputMapper>()->getDevices(); |
| 396 | 409 | for(const auto& deviceMapping : devices) { |