From 7b51061b5f3eee889b6d5f7ea4cec5e502518650 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Sun, 10 Mar 2019 19:46:01 -0700 Subject: [PATCH] fixing initialization in switch statement --- interface/src/Application.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 215736001c..3230419816 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4047,6 +4047,7 @@ void Application::keyPressEvent(QKeyEvent* event) { _keysPressed.insert(event->key(), *event); } + auto audioScriptingInterface = reinterpret_cast(DependencyManager::get().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(DependencyManager::get().data()); audioScriptingInterface->setPushingToTalk(true); break; @@ -4325,9 +4325,9 @@ void Application::keyReleaseEvent(QKeyEvent* event) { _keyboardMouseDevice->keyReleaseEvent(event); } + auto audioScriptingInterface = reinterpret_cast(DependencyManager::get().data()); switch (event->key()) { case Qt::Key_T: - auto audioScriptingInterface = reinterpret_cast(DependencyManager::get().data()); audioScriptingInterface->setPushingToTalk(false); break; }