From e7d14b938177785e0a23b023d422dd7f8ea71cd2 Mon Sep 17 00:00:00 2001 From: Faye Li Si Fi Date: Thu, 5 Jan 2017 16:49:55 -0800 Subject: [PATCH 1/7] Adding new property "showKeyboardFocusHighlight" to Web3DOverlay --- interface/src/ui/overlays/Web3DOverlay.cpp | 8 ++++++++ interface/src/ui/overlays/Web3DOverlay.h | 1 + 2 files changed, 9 insertions(+) diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index fe48b05f5e..960536fe63 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -355,6 +355,11 @@ void Web3DOverlay::setProperties(const QVariantMap& properties) { if (dpi.isValid()) { _dpi = dpi.toFloat(); } + + auto showKeyboardFocusHighlight = properties["showKeyboardFocusHighlight"]; + if (showKeyboardFocusHighlight.isValid()) { + _showKeyboardFocusHighlight = showKeyboardFocusHighlight.toBool; + } } QVariant Web3DOverlay::getProperty(const QString& property) { @@ -370,6 +375,9 @@ QVariant Web3DOverlay::getProperty(const QString& property) { if (property == "dpi") { return _dpi; } + if (property == "showKeyboardFocusHighlight") { + return _showKeyboardFocusHighlight; + } return Billboard3DOverlay::getProperty(property); } diff --git a/interface/src/ui/overlays/Web3DOverlay.h b/interface/src/ui/overlays/Web3DOverlay.h index db45b073e2..18fefb6885 100644 --- a/interface/src/ui/overlays/Web3DOverlay.h +++ b/interface/src/ui/overlays/Web3DOverlay.h @@ -68,6 +68,7 @@ private: float _dpi; vec2 _resolution{ 640, 480 }; int _geometryId { 0 }; + bool _showKeyboardFocusHighlight{ true }; bool _pressed{ false }; QTouchDevice _touchDevice; From d0d89e216d9f116e55447383f0484eb495784e8e Mon Sep 17 00:00:00 2001 From: Faye Li Si Fi Date: Mon, 9 Jan 2017 09:54:41 -0800 Subject: [PATCH 2/7] Add showKeyboardFocusHighlight in constructor --- interface/src/ui/overlays/Web3DOverlay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index 960536fe63..eb93fe6f47 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -50,7 +50,8 @@ Web3DOverlay::Web3DOverlay(const Web3DOverlay* Web3DOverlay) : _url(Web3DOverlay->_url), _scriptURL(Web3DOverlay->_scriptURL), _dpi(Web3DOverlay->_dpi), - _resolution(Web3DOverlay->_resolution) + _resolution(Web3DOverlay->_resolution), + _showKeyboardFocusHighlight(Web3DOverlay->_showKeyboardFocusHighlight) { _geometryId = DependencyManager::get()->allocateID(); } From 2fa17ea6a7857df5da6a3485db76c08c7ce00caa Mon Sep 17 00:00:00 2001 From: Faye Li Si Fi Date: Mon, 9 Jan 2017 10:23:31 -0800 Subject: [PATCH 3/7] fix missing parenthesis --- interface/src/ui/overlays/Web3DOverlay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index eb93fe6f47..bd21305023 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -359,7 +359,7 @@ void Web3DOverlay::setProperties(const QVariantMap& properties) { auto showKeyboardFocusHighlight = properties["showKeyboardFocusHighlight"]; if (showKeyboardFocusHighlight.isValid()) { - _showKeyboardFocusHighlight = showKeyboardFocusHighlight.toBool; + _showKeyboardFocusHighlight = showKeyboardFocusHighlight.toBool(); } } From 93e4f9126f8133a4e81c1348fab3422831615f7d Mon Sep 17 00:00:00 2001 From: Faye Li Si Fi Date: Mon, 9 Jan 2017 11:01:15 -0800 Subject: [PATCH 4/7] disable drawing highlight if "showKeyboardFocusHighlight" flag is false --- interface/src/Application.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 212c06d410..e4966dc172 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4076,9 +4076,11 @@ void Application::setKeyboardFocusOverlay(unsigned int overlayID) { } _lastAcceptedKeyPress = usecTimestampNow(); - auto size = overlay->getSize() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR; - const float OVERLAY_DEPTH = 0.0105f; - setKeyboardFocusHighlight(overlay->getPosition(), overlay->getRotation(), glm::vec3(size.x, size.y, OVERLAY_DEPTH)); + if (overlay->getProperty("showKeyboardFocusHighlight").toBool()) { + auto size = overlay->getSize() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR; + const float OVERLAY_DEPTH = 0.0105f; + setKeyboardFocusHighlight(overlay->getPosition(), overlay->getRotation(), glm::vec3(size.x, size.y, OVERLAY_DEPTH)); + } } } } From 5323e7f34dcec8e22242a9e39a4468d62aa718c8 Mon Sep 17 00:00:00 2001 From: Faye Li Si Fi Date: Mon, 9 Jan 2017 13:36:58 -0800 Subject: [PATCH 5/7] set showKeyboardHighlight to false when initialising tablet --- scripts/system/libraries/WebTablet.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index c894642f80..d4e9f3194a 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -90,7 +90,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly) { color: { red: 255, green: 255, blue: 255 }, alpha: 1.0, parentID: this.tabletEntityID, - parentJointIndex: -1 + parentJointIndex: -1, + showKeyboardFocusHighlight: false }); var HOME_BUTTON_Y_OFFSET = -0.25; From c39eb6294e164cba89669f8764400dac5be80999 Mon Sep 17 00:00:00 2001 From: Faye Li Si Fi Date: Mon, 9 Jan 2017 14:01:59 -0800 Subject: [PATCH 6/7] undo --- scripts/system/libraries/WebTablet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index d4e9f3194a..2bd6c6a6a1 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -91,7 +91,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly) { alpha: 1.0, parentID: this.tabletEntityID, parentJointIndex: -1, - showKeyboardFocusHighlight: false + showKeyboardFocusHighlight: true }); var HOME_BUTTON_Y_OFFSET = -0.25; From 32eda3a49cc7a3903a79e49ee808fae2055f157d Mon Sep 17 00:00:00 2001 From: Faye Li Si Fi Date: Mon, 9 Jan 2017 14:02:14 -0800 Subject: [PATCH 7/7] redo --- scripts/system/libraries/WebTablet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 2bd6c6a6a1..d4e9f3194a 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -91,7 +91,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly) { alpha: 1.0, parentID: this.tabletEntityID, parentJointIndex: -1, - showKeyboardFocusHighlight: true + showKeyboardFocusHighlight: false }); var HOME_BUTTON_Y_OFFSET = -0.25;