From 015799712655804e54a4516fa7ff64c3a08b4278 Mon Sep 17 00:00:00 2001 From: Sam Gondelman Date: Wed, 17 Jun 2015 14:42:11 -0700 Subject: [PATCH] fix findDevice --- interface/src/scripting/ControllerScriptingInterface.cpp | 2 +- interface/src/ui/UserInputMapper.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/scripting/ControllerScriptingInterface.cpp b/interface/src/scripting/ControllerScriptingInterface.cpp index 5bee51c9b9..851c523c5d 100644 --- a/interface/src/scripting/ControllerScriptingInterface.cpp +++ b/interface/src/scripting/ControllerScriptingInterface.cpp @@ -462,7 +462,7 @@ void ControllerScriptingInterface::resetDevice(unsigned int device) { } int ControllerScriptingInterface::findDevice(QString name) { - Application::getUserInputMapper()->findDevice(name); + return Application::getUserInputMapper()->findDevice(name); } InputController::InputController(int deviceTrackerId, int subTrackerId, QObject* parent) : diff --git a/interface/src/ui/UserInputMapper.cpp b/interface/src/ui/UserInputMapper.cpp index 127aead761..fd2f384fb6 100755 --- a/interface/src/ui/UserInputMapper.cpp +++ b/interface/src/ui/UserInputMapper.cpp @@ -50,7 +50,7 @@ void UserInputMapper::resetDevice(uint16 deviceID) { int UserInputMapper::findDevice(QString name) { for (auto device : _registeredDevices) { - if (device.second->_name == name) { + if (device.second->_name.split(" (")[0] == name) { return device.first; } }