History

in 2d mode, clicks on tablet don't get used for other things

Seth Alves committed 9 years ago

Commit 70060eb1 parent 73774a67 files · +57 −23Browse files

Showing the changes to interface/src/Application.cpp (1 of 7 files). Show all

Unified · Split

interface/src/Application.cpp+27−13
@@ -3097,17 +3097,23 @@ void Application::mouseMoveEvent(QMouseEvent* event) { · 3096 unmodified lines
3097 3097
3098 if (compositor.getReticleVisible() || !isHMDMode() || !compositor.getReticleOverDesktop() ||3098 if (compositor.getReticleVisible() || !isHMDMode() || !compositor.getReticleOverDesktop() ||
3099 getOverlays().getOverlayAtPoint(glm::vec2(transformedPos.x(), transformedPos.y())) != UNKNOWN_OVERLAY_ID) {3099 getOverlays().getOverlayAtPoint(glm::vec2(transformedPos.x(), transformedPos.y())) != UNKNOWN_OVERLAY_ID) {
3100 getOverlays().mouseMoveEvent(&mappedEvent);3100 if (_mouseToOverlays) {
3101 getEntities()->mouseMoveEvent(&mappedEvent);3101 getOverlays().mouseMoveEvent(&mappedEvent);
3102 } else {
3103 getEntities()->mouseMoveEvent(&mappedEvent);
3104 }
3105 }
3106
3107 if (!_mouseToOverlays) {
3108 _controllerScriptingInterface->emitMouseMoveEvent(&mappedEvent); // send events to any registered scripts
3102 }3109 }
3103 _controllerScriptingInterface->emitMouseMoveEvent(&mappedEvent); // send events to any registered scripts
3104 3110
3105 // if one of our scripts have asked to capture this event, then stop processing it3111 // if one of our scripts have asked to capture this event, then stop processing it
3106 if (_controllerScriptingInterface->isMouseCaptured()) {3112 if (_controllerScriptingInterface->isMouseCaptured()) {
3107 return;3113 return;
3108 }3114 }
3109 3115
3110 if (_keyboardMouseDevice->isActive()) {3116 if (!_mouseToOverlays && _keyboardMouseDevice->isActive()) {
3111 _keyboardMouseDevice->mouseMoveEvent(event);3117 _keyboardMouseDevice->mouseMoveEvent(event);
3112 }3118 }
3113}3119}
@@ -3115,6 +3121,7 @@ void Application::mouseMoveEvent(QMouseEvent* event) { · 1 unmodified line
3115void Application::mousePressEvent(QMouseEvent* event) {3121void Application::mousePressEvent(QMouseEvent* event) {
3116 // Inhibit the menu if the user is using alt-mouse dragging3122 // Inhibit the menu if the user is using alt-mouse dragging
3117 _altPressed = false;3123 _altPressed = false;
3124 _mouseToOverlays = false;
3118 3125
3119 auto offscreenUi = DependencyManager::get<OffscreenUi>();3126 auto offscreenUi = DependencyManager::get<OffscreenUi>();
3120 // If we get a mouse press event it means it wasn't consumed by the offscreen UI,3127 // If we get a mouse press event it means it wasn't consumed by the offscreen UI,
@@ -3131,21 +3138,23 @@ void Application::mousePressEvent(QMouseEvent* event) { · 10 unmodified lines
3131 event->buttons(), event->modifiers());3138 event->buttons(), event->modifiers());
3132 3139
3133 if (!_aboutToQuit) {3140 if (!_aboutToQuit) {
3134 getOverlays().mousePressEvent(&mappedEvent);3141 if (getOverlays().mousePressEvent(&mappedEvent)) {
3135 3142 _mouseToOverlays = true;
3136 if (!_controllerScriptingInterface->areEntityClicksCaptured()) {3143 } else if (!_controllerScriptingInterface->areEntityClicksCaptured()) {
3137 getEntities()->mousePressEvent(&mappedEvent);3144 getEntities()->mousePressEvent(&mappedEvent);
3138 }3145 }
3139 }3146 }
3140 3147
3141 _controllerScriptingInterface->emitMousePressEvent(&mappedEvent); // send events to any registered scripts3148 if (!_mouseToOverlays) {
3149 _controllerScriptingInterface->emitMousePressEvent(&mappedEvent); // send events to any registered scripts
3150 }
3142 3151
3143 // if one of our scripts have asked to capture this event, then stop processing it3152 // if one of our scripts have asked to capture this event, then stop processing it
3144 if (_controllerScriptingInterface->isMouseCaptured()) {3153 if (_controllerScriptingInterface->isMouseCaptured()) {
3145 return;3154 return;
3146 }3155 }
3147 3156
3148 if (hasFocus()) {3157 if (!_mouseToOverlays && hasFocus()) {
3149 if (_keyboardMouseDevice->isActive()) {3158 if (_keyboardMouseDevice->isActive()) {
3150 _keyboardMouseDevice->mousePressEvent(event);3159 _keyboardMouseDevice->mousePressEvent(event);
3151 }3160 }
@@ -3179,18 +3188,23 @@ void Application::mouseReleaseEvent(QMouseEvent* event) { · 27 unmodified lines
3179 event->buttons(), event->modifiers());3188 event->buttons(), event->modifiers());
3180 3189
3181 if (!_aboutToQuit) {3190 if (!_aboutToQuit) {
3182 getOverlays().mouseReleaseEvent(&mappedEvent);3191 if (_mouseToOverlays) {
3183 getEntities()->mouseReleaseEvent(&mappedEvent);3192 getOverlays().mouseReleaseEvent(&mappedEvent);
3193 } else {
3194 getEntities()->mouseReleaseEvent(&mappedEvent);
3195 }
3184 }3196 }
3185 3197
3186 _controllerScriptingInterface->emitMouseReleaseEvent(&mappedEvent); // send events to any registered scripts3198 if (!_mouseToOverlays) {
3199 _controllerScriptingInterface->emitMouseReleaseEvent(&mappedEvent); // send events to any registered scripts
3200 }
3187 3201
3188 // if one of our scripts have asked to capture this event, then stop processing it3202 // if one of our scripts have asked to capture this event, then stop processing it
3189 if (_controllerScriptingInterface->isMouseCaptured()) {3203 if (_controllerScriptingInterface->isMouseCaptured()) {
3190 return;3204 return;
3191 }3205 }
3192 3206
3193 if (hasFocus()) {3207 if (!_mouseToOverlays && hasFocus()) {
3194 if (_keyboardMouseDevice->isActive()) {3208 if (_keyboardMouseDevice->isActive()) {
3195 _keyboardMouseDevice->mouseReleaseEvent(event);3209 _keyboardMouseDevice->mouseReleaseEvent(event);
3196 }3210 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t