MCPcopy Create free account
hub / github.com/apache/cloudstack / _handleMouseMove

Method _handleMouseMove

systemvm/agent/noVNC/core/rfb.js:1337–1354  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

1335 }
1336
1337 _handleMouseMove(x, y) {
1338 this._mousePos = { 'x': x, 'y': y };
1339
1340 // Limit many mouse move events to one every MOUSE_MOVE_DELAY ms
1341 if (this._mouseMoveTimer == null) {
1342
1343 const timeSinceLastMove = Date.now() - this._mouseLastMoveTime;
1344 if (timeSinceLastMove > MOUSE_MOVE_DELAY) {
1345 this._sendMouse(x, y, this._mouseButtonMask);
1346 this._mouseLastMoveTime = Date.now();
1347 } else {
1348 // Too soon since the latest move, wait the remaining time
1349 this._mouseMoveTimer = setTimeout(() => {
1350 this._handleDelayedMouseMove();
1351 }, MOUSE_MOVE_DELAY - timeSinceLastMove);
1352 }
1353 }
1354 }
1355
1356 _handleDelayedMouseMove() {
1357 this._mouseMoveTimer = null;

Callers 2

_handleMouseMethod · 0.95
_fakeMouseMoveMethod · 0.95

Calls 3

_sendMouseMethod · 0.95
nowMethod · 0.80

Tested by

no test coverage detected