Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -681,6 +681,9 @@ void Application::controlledBroadcastToNodes(unsigned char* broadcastData, size_ · 680 unmodified lines | ||
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | void Application::keyPressEvent(QKeyEvent* event) { |
| 684 | + | |
| 685 | + _controllerScriptingInterface.emitKeyPressEvent(event); // send events to any registered scripts | |
| 686 | + | |
| 684 | 687 | if (activeWindow() == _window) { |
| 685 | 688 | if (_chatEntryOn) { |
| 686 | 689 | if (_chatEntry.keyPressEvent(event)) { |
| @@ -1092,6 +1095,9 @@ void Application::keyPressEvent(QKeyEvent* event) { · 405 unmodified lines | ||
| 1092 | 1095 | } |
| 1093 | 1096 | |
| 1094 | 1097 | void Application::keyReleaseEvent(QKeyEvent* event) { |
| 1098 | + | |
| 1099 | + _controllerScriptingInterface.emitKeyReleaseEvent(event); // send events to any registered scripts | |
| 1100 | + | |
| 1095 | 1101 | if (activeWindow() == _window) { |
| 1096 | 1102 | if (_chatEntryOn) { |
| 1097 | 1103 | _myAvatar.setKeyState(NO_KEY_DOWN); |
| @@ -1154,6 +1160,8 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 56 unmodified lines | ||
| 1154 | 1160 | } |
| 1155 | 1161 | |
| 1156 | 1162 | void Application::mouseMoveEvent(QMouseEvent* event) { |
| 1163 | + _controllerScriptingInterface.emitMouseMoveEvent(event); // send events to any registered scripts | |
| 1164 | + | |
| 1157 | 1165 | _lastMouseMove = usecTimestampNow(); |
| 1158 | 1166 | if (_mouseHidden) { |
| 1159 | 1167 | getGLWidget()->setCursor(Qt::ArrowCursor); |
| @@ -1200,6 +1208,7 @@ const float HOVER_VOXEL_FREQUENCY = 7040.f; · 40 unmodified lines | ||
| 1200 | 1208 | const float HOVER_VOXEL_DECAY = 0.999f; |
| 1201 | 1209 | |
| 1202 | 1210 | void Application::mousePressEvent(QMouseEvent* event) { |
| 1211 | + _controllerScriptingInterface.emitMousePressEvent(event); // send events to any registered scripts | |
| 1203 | 1212 | if (activeWindow() == _window) { |
| 1204 | 1213 | if (event->button() == Qt::LeftButton) { |
| 1205 | 1214 | _mouseX = event->x(); |
| @@ -1267,6 +1276,7 @@ void Application::mousePressEvent(QMouseEvent* event) { · 61 unmodified lines | ||
| 1267 | 1276 | } |
| 1268 | 1277 | |
| 1269 | 1278 | void Application::mouseReleaseEvent(QMouseEvent* event) { |
| 1279 | + _controllerScriptingInterface.emitMouseReleaseEvent(event); // send events to any registered scripts | |
| 1270 | 1280 | if (activeWindow() == _window) { |
| 1271 | 1281 | if (event->button() == Qt::LeftButton) { |
| 1272 | 1282 | _mouseX = event->x(); |
| @@ -1283,6 +1293,7 @@ void Application::mouseReleaseEvent(QMouseEvent* event) { · 10 unmodified lines | ||
| 1283 | 1293 | } |
| 1284 | 1294 | |
| 1285 | 1295 | void Application::touchUpdateEvent(QTouchEvent* event) { |
| 1296 | + _controllerScriptingInterface.emitTouchUpdateEvent(event); // send events to any registered scripts | |
| 1286 | 1297 | bool validTouch = false; |
| 1287 | 1298 | if (activeWindow() == _window) { |
| 1288 | 1299 | const QList<QTouchEvent::TouchPoint>& tPoints = event->touchPoints(); |
| @@ -1307,12 +1318,15 @@ void Application::touchUpdateEvent(QTouchEvent* event) { · 18 unmodified lines | ||
| 1307 | 1318 | } |
| 1308 | 1319 | |
| 1309 | 1320 | void Application::touchBeginEvent(QTouchEvent* event) { |
| 1321 | + _controllerScriptingInterface.emitTouchBeginEvent(event); // send events to any registered scripts | |
| 1322 | + | |
| 1310 | 1323 | touchUpdateEvent(event); |
| 1311 | 1324 | _lastTouchAvgX = _touchAvgX; |
| 1312 | 1325 | _lastTouchAvgY = _touchAvgY; |
| 1313 | 1326 | } |
| 1314 | 1327 | |
| 1315 | 1328 | void Application::touchEndEvent(QTouchEvent* event) { |
| 1329 | + _controllerScriptingInterface.emitTouchEndEvent(event); // send events to any registered scripts | |
| 1316 | 1330 | _touchDragStartedAvgX = _touchAvgX; |
| 1317 | 1331 | _touchDragStartedAvgY = _touchAvgY; |
| 1318 | 1332 | _isTouchPressed = false; |
| @@ -1320,6 +1334,9 @@ void Application::touchEndEvent(QTouchEvent* event) { · 1 unmodified line | ||
| 1320 | 1334 | |
| 1321 | 1335 | const bool USE_MOUSEWHEEL = false; |
| 1322 | 1336 | void Application::wheelEvent(QWheelEvent* event) { |
| 1337 | + | |
| 1338 | + _controllerScriptingInterface.emitWheelEvent(event); // send events to any registered scripts | |
| 1339 | + | |
| 1323 | 1340 | // Wheel Events disabled for now because they are also activated by touch look pitch up/down. |
| 1324 | 1341 | if (USE_MOUSEWHEEL && (activeWindow() == _window)) { |
| 1325 | 1342 | if (!Menu::getInstance()->isVoxelModeActionChecked()) { |