Showing the changes to interface/src/Application.cpp (1 of 9 files). Show all
Unified · Split
| @@ -155,7 +155,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 154 unmodified lines | ||
| 155 | 155 | _mouseX(0), |
| 156 | 156 | _mouseY(0), |
| 157 | 157 | _lastMouseMove(usecTimestampNow()), |
| 158 | − _lastMouseMoveType(QEvent::MouseMove), | |
| 158 | + _lastMouseMoveWasSimulated(false), | |
| 159 | 159 | _mouseHidden(false), |
| 160 | 160 | _seenMouseMove(false), |
| 161 | 161 | _touchAvgX(0.0f), |
| @@ -1141,18 +1141,19 @@ void Application::focusOutEvent(QFocusEvent* event) { · 979 unmodified lines | ||
| 1141 | 1141 | _keysPressed.clear(); |
| 1142 | 1142 | } |
| 1143 | 1143 | |
| 1144 | −void Application::mouseMoveEvent(QMouseEvent* event) { | |
| 1144 | +void Application::mouseMoveEvent(QMouseEvent* event, unsigned int deviceID) { | |
| 1145 | 1145 | |
| 1146 | 1146 | bool showMouse = true; |
| 1147 | + | |
| 1148 | + // Used by application overlay to determine how to draw cursor(s) | |
| 1149 | + _lastMouseMoveWasSimulated = deviceID > 0; | |
| 1150 | + | |
| 1147 | 1151 | // If this mouse move event is emitted by a controller, dont show the mouse cursor |
| 1148 | − if (event->type() == CONTROLLER_MOVE_EVENT) { | |
| 1152 | + if (_lastMouseMoveWasSimulated) { | |
| 1149 | 1153 | showMouse = false; |
| 1150 | 1154 | } |
| 1151 | 1155 | |
| 1152 | − // Used by application overlay to determine how to draw cursor(s) | |
| 1153 | − _lastMouseMoveType = event->type(); | |
| 1154 | − | |
| 1155 | − _controllerScriptingInterface.emitMouseMoveEvent(event); // send events to any registered scripts | |
| 1156 | + _controllerScriptingInterface.emitMouseMoveEvent(event, deviceID); // send events to any registered scripts | |
| 1156 | 1157 | |
| 1157 | 1158 | // if one of our scripts have asked to capture this event, then stop processing it |
| 1158 | 1159 | if (_controllerScriptingInterface.isMouseCaptured()) { |
| @@ -1171,7 +1172,7 @@ void Application::mouseMoveEvent(QMouseEvent* event) { · 12 unmodified lines | ||
| 1171 | 1172 | _mouseY = event->y(); |
| 1172 | 1173 | } |
| 1173 | 1174 | |
| 1174 | −void Application::mousePressEvent(QMouseEvent* event) { | |
| 1175 | +void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { | |
| 1175 | 1176 | _controllerScriptingInterface.emitMousePressEvent(event); // send events to any registered scripts |
| 1176 | 1177 | |
| 1177 | 1178 | // if one of our scripts have asked to capture this event, then stop processing it |
| @@ -1204,7 +1205,7 @@ void Application::mousePressEvent(QMouseEvent* event) { · 26 unmodified lines | ||
| 1204 | 1205 | } |
| 1205 | 1206 | } |
| 1206 | 1207 | |
| 1207 | −void Application::mouseReleaseEvent(QMouseEvent* event) { | |
| 1208 | +void Application::mouseReleaseEvent(QMouseEvent* event, unsigned int deviceID) { | |
| 1208 | 1209 | _controllerScriptingInterface.emitMouseReleaseEvent(event); // send events to any registered scripts |
| 1209 | 1210 | |
| 1210 | 1211 | // if one of our scripts have asked to capture this event, then stop processing it |