Merge pull request #6204 from ZappoMan/hardwareChanged

emit hardwareChanged signal to scripts
This commit is contained in:
Clément Brisset 2015-10-28 12:26:09 -07:00
commit 3be06a576a
3 changed files with 9 additions and 3 deletions

View file

@ -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]);
});
*/
*/
Controller.hardwareChanged.connect(function () {
print("hardwareChanged");
});

View file

@ -48,11 +48,11 @@ controller::ScriptingInterface::ScriptingInterface() {
connect(userInputMapper.data(), &UserInputMapper::inputEvent, this, &controller::ScriptingInterface::inputEvent);
// FIXME make this thread safe
connect(userInputMapper.data(), &UserInputMapper::hardwareChanged, [=] {
connect(userInputMapper.data(), &UserInputMapper::hardwareChanged, this, [=] {
updateMaps();
emit hardwareChanged();
});
qCDebug(controllers) << "Setting up standard controller abstraction";
_standard = createDeviceMap(userInputMapper->getStandardDevice());

View file

@ -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