Merge pull request #19 from wayne-chen/pushToTalk

fixing initialization in switch statement
This commit is contained in:
Wayne Chen 2019-03-10 19:46:50 -07:00 committed by GitHub
commit 1b628bc8e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4047,6 +4047,7 @@ void Application::keyPressEvent(QKeyEvent* event) {
_keysPressed.insert(event->key(), *event);
}
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
_controllerScriptingInterface->emitKeyPressEvent(event); // send events to any registered scripts
// if one of our scripts have asked to capture this event, then stop processing it
if (_controllerScriptingInterface->isKeyCaptured(event) || isInterstitialMode()) {
@ -4215,7 +4216,6 @@ void Application::keyPressEvent(QKeyEvent* event) {
break;
case Qt::Key_T:
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
audioScriptingInterface->setPushingToTalk(true);
break;
@ -4325,9 +4325,9 @@ void Application::keyReleaseEvent(QKeyEvent* event) {
_keyboardMouseDevice->keyReleaseEvent(event);
}
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
switch (event->key()) {
case Qt::Key_T:
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
audioScriptingInterface->setPushingToTalk(false);
break;
}