mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Moving to InputEndpoint, fixing build problem
This commit is contained in:
parent
de57c3b4d6
commit
a124d3b433
2 changed files with 3 additions and 9 deletions
|
@ -629,12 +629,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||||
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
||||||
connect(userInputMapper.data(), &UserInputMapper::actionEvent, _controllerScriptingInterface, &ControllerScriptingInterface::actionEvent);
|
connect(userInputMapper.data(), &UserInputMapper::actionEvent, _controllerScriptingInterface, &ControllerScriptingInterface::actionEvent);
|
||||||
connect(userInputMapper.data(), &UserInputMapper::actionEvent, [this](int action, float state) {
|
connect(userInputMapper.data(), &UserInputMapper::actionEvent, [this](int action, float state) {
|
||||||
if (state) {
|
if (state && action == toInt(controller::Action::TOGGLE_MUTE)) {
|
||||||
switch (action) {
|
DependencyManager::get<AudioClient>()->toggleMute();
|
||||||
case controller::Action::TOGGLE_MUTE:
|
|
||||||
DependencyManager::get<AudioClient>()->toggleMute();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -255,9 +255,7 @@ void UserInputMapper::registerDevice(InputDevice* device) {
|
||||||
} else if (input.device == ACTIONS_DEVICE) {
|
} else if (input.device == ACTIONS_DEVICE) {
|
||||||
endpoint = std::make_shared<ActionEndpoint>(input);
|
endpoint = std::make_shared<ActionEndpoint>(input);
|
||||||
} else {
|
} else {
|
||||||
endpoint = std::make_shared<LambdaEndpoint>([=] {
|
endpoint = std::make_shared<InputEndpoint>(input);
|
||||||
return proxy->getValue(input, 0);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
_inputsByEndpoint[endpoint] = input;
|
_inputsByEndpoint[endpoint] = input;
|
||||||
_endpointsByInput[input] = endpoint;
|
_endpointsByInput[input] = endpoint;
|
||||||
|
|
Loading…
Reference in a new issue