diff --git a/examples/controllers/controllerMappings.js b/examples/controllers/controllerMappings.js index 66efa63676..42494816f4 100644 --- a/examples/controllers/controllerMappings.js +++ b/examples/controllers/controllerMappings.js @@ -87,4 +87,9 @@ Object.keys(Controller.Hardware).forEach(function (deviceName) { Object.keys(Controller.Actions).forEach(function (actionName) { print("Controller.Actions." + actionName + ":" + Controller.Actions[actionName]); }); -*/ \ No newline at end of file +*/ + + +Controller.hardwareChanged.connect(function () { + print("hardwareChanged"); +}); \ No newline at end of file diff --git a/libraries/controllers/src/controllers/ScriptingInterface.cpp b/libraries/controllers/src/controllers/ScriptingInterface.cpp index bb09705684..b5630cfab1 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.cpp +++ b/libraries/controllers/src/controllers/ScriptingInterface.cpp @@ -50,6 +50,7 @@ controller::ScriptingInterface::ScriptingInterface() { // FIXME make this thread safe connect(userInputMapper.data(), &UserInputMapper::hardwareChanged, [=] { updateMaps(); + emit hardwareChanged(); }); diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h index db724044fa..9af478e709 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.h +++ b/libraries/controllers/src/controllers/ScriptingInterface.h @@ -132,6 +132,7 @@ namespace controller { signals: void actionEvent(int action, float state); void inputEvent(int action, float state); + void hardwareChanged(); private: // Update the exposed variant maps reporting active hardware