mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:18:52 +02:00
Merge pull request #5723 from jherico/lisa
Toggle mute while holding the hydras
This commit is contained in:
commit
670c5ee484
3 changed files with 16 additions and 0 deletions
|
@ -612,6 +612,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
// Setup the userInputMapper with the actions
|
// Setup the userInputMapper with the actions
|
||||||
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
||||||
connect(userInputMapper.data(), &UserInputMapper::actionEvent, &_controllerScriptingInterface, &AbstractControllerScriptingInterface::actionEvent);
|
connect(userInputMapper.data(), &UserInputMapper::actionEvent, &_controllerScriptingInterface, &AbstractControllerScriptingInterface::actionEvent);
|
||||||
|
connect(userInputMapper.data(), &UserInputMapper::actionEvent, [this](int action, float state) {
|
||||||
|
if (state) {
|
||||||
|
switch (action) {
|
||||||
|
case UserInputMapper::Action::TOGGLE_MUTE:
|
||||||
|
DependencyManager::get<AudioClient>()->toggleMute();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Setup the keyboardMouseDevice and the user input mapper with the default bindings
|
// Setup the keyboardMouseDevice and the user input mapper with the default bindings
|
||||||
_keyboardMouseDevice->registerToUserInputMapper(*userInputMapper);
|
_keyboardMouseDevice->registerToUserInputMapper(*userInputMapper);
|
||||||
|
|
|
@ -595,6 +595,10 @@ void SixenseManager::assignDefaultInputMapping(UserInputMapper& mapper) {
|
||||||
mapper.addInputChannel(UserInputMapper::LEFT_HAND_CLICK, makeInput(BACK_TRIGGER, 0));
|
mapper.addInputChannel(UserInputMapper::LEFT_HAND_CLICK, makeInput(BACK_TRIGGER, 0));
|
||||||
mapper.addInputChannel(UserInputMapper::RIGHT_HAND_CLICK, makeInput(BACK_TRIGGER, 1));
|
mapper.addInputChannel(UserInputMapper::RIGHT_HAND_CLICK, makeInput(BACK_TRIGGER, 1));
|
||||||
|
|
||||||
|
// TODO find a mechanism to allow users to navigate the context menu via
|
||||||
|
mapper.addInputChannel(UserInputMapper::CONTEXT_MENU, makeInput(BUTTON_0, 0));
|
||||||
|
mapper.addInputChannel(UserInputMapper::TOGGLE_MUTE, makeInput(BUTTON_0, 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UserInputMapper::Input SixenseManager::makeInput(unsigned int button, int index) {
|
UserInputMapper::Input SixenseManager::makeInput(unsigned int button, int index) {
|
||||||
|
|
|
@ -162,6 +162,9 @@ public:
|
||||||
ACTION1,
|
ACTION1,
|
||||||
ACTION2,
|
ACTION2,
|
||||||
|
|
||||||
|
CONTEXT_MENU,
|
||||||
|
TOGGLE_MUTE,
|
||||||
|
|
||||||
NUM_ACTIONS,
|
NUM_ACTIONS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue