History

Add option to disable triggering an away state when interface focus is lost.

Saracen committed 7 years ago

Commit 90e979b1 parent 6ccf16d6 files · +53 −2Browse files

Showing the changes to interface/src/scripting/HMDScriptingInterface.cpp (1 of 6 files). Show all

Unified · Split

interface/src/scripting/HMDScriptingInterface.cpp+11−0
@@ -30,6 +30,9 @@ HMDScriptingInterface::HMDScriptingInterface() { · 29 unmodified lines
3030 connect(qApp, &Application::miniTabletEnabledChanged, [this](bool enabled) {
3131 emit miniTabletEnabledChanged(enabled);
3232 });
33+ connect(qApp, &Application::awayStateWhenFocusLostInVRChanged, [this](bool enabled) {
34+ emit awayStateWhenFocusLostInVRChanged(enabled);
35+ });
3336 }
3437
3538 glm::vec3 HMDScriptingInterface::calculateRayUICollisionPoint(const glm::vec3& position, const glm::vec3& direction) const {
@@ -137,6 +140,14 @@ bool HMDScriptingInterface::getMiniTabletEnabled() { · 101 unmodified lines
137140 return qApp->getMiniTabletEnabled();
138141 }
139142
143+void HMDScriptingInterface::setAwayStateWhenFocusLostInVREnabled(bool enabled) {
144+ qApp->setAwayStateWhenFocusLostInVREnabled(enabled);
145+}
146+
147+bool HMDScriptingInterface::getAwayStateWhenFocusLostInVREnabled() {
148+ return qApp->getAwayStateWhenFocusLostInVREnabled();
149+}
150+
140151
141152 QScriptValue HMDScriptingInterface::getHUDLookAtPosition2D(QScriptContext* context, QScriptEngine* engine) {
142153 glm::vec3 hudIntersection;