From a124d3b4332205436b73997079600f52c3dd03c0 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Tue, 20 Oct 2015 22:00:16 -0700 Subject: [PATCH] Moving to InputEndpoint, fixing build problem --- interface/src/Application.cpp | 8 ++------ libraries/controllers/src/controllers/UserInputMapper.cpp | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4e23e19652..4418f94b3a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -629,12 +629,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : auto userInputMapper = DependencyManager::get(); connect(userInputMapper.data(), &UserInputMapper::actionEvent, _controllerScriptingInterface, &ControllerScriptingInterface::actionEvent); connect(userInputMapper.data(), &UserInputMapper::actionEvent, [this](int action, float state) { - if (state) { - switch (action) { - case controller::Action::TOGGLE_MUTE: - DependencyManager::get()->toggleMute(); - break; - } + if (state && action == toInt(controller::Action::TOGGLE_MUTE)) { + DependencyManager::get()->toggleMute(); } }); diff --git a/libraries/controllers/src/controllers/UserInputMapper.cpp b/libraries/controllers/src/controllers/UserInputMapper.cpp index 5d93150aed..74b3db0d57 100755 --- a/libraries/controllers/src/controllers/UserInputMapper.cpp +++ b/libraries/controllers/src/controllers/UserInputMapper.cpp @@ -255,9 +255,7 @@ void UserInputMapper::registerDevice(InputDevice* device) { } else if (input.device == ACTIONS_DEVICE) { endpoint = std::make_shared(input); } else { - endpoint = std::make_shared([=] { - return proxy->getValue(input, 0); - }); + endpoint = std::make_shared(input); } _inputsByEndpoint[endpoint] = input; _endpointsByInput[input] = endpoint;