1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

More work on RDP integration to Desktop tab.

This commit is contained in:
Ylian Saint-Hilaire 2022-05-03 13:31:58 -07:00
parent 96dab9ab3e
commit 3d549dc187
4 changed files with 28 additions and 19 deletions

View file

@ -118,6 +118,7 @@ var CreateRDPDesktop = function (canvasid) {
obj.m.mousemove = function (e) {
if (!obj.socket || (obj.State != 3)) return;
var m = getMousePosition(e);
if ((m.x < 0) || (m.y < 0) || (m.x > obj.ScreenWidth) || (m.y > obj.ScreenHeight)) return;
obj.mouseNagleData = ['mouse', m.x, m.y, 0, false];
if (obj.mouseNagleTimer == null) { obj.mouseNagleTimer = setTimeout(function () { obj.socket.send(JSON.stringify(obj.mouseNagleData)); obj.mouseNagleTimer = null; }, 50); }
e.preventDefault();
@ -125,16 +126,18 @@ var CreateRDPDesktop = function (canvasid) {
}
obj.m.mouseup = function (e) {
if (!obj.socket || (obj.State != 3)) return;
if (obj.mouseNagleTimer != null) { clearTimeout(obj.mouseNagleTimer); obj.mouseNagleTimer = null; }
var m = getMousePosition(e);
if ((m.x < 0) || (m.y < 0) || (m.x > obj.ScreenWidth) || (m.y > obj.ScreenHeight)) return;
if (obj.mouseNagleTimer != null) { clearTimeout(obj.mouseNagleTimer); obj.mouseNagleTimer = null; }
obj.socket.send(JSON.stringify(['mouse', m.x, m.y, mouseButtonMap(e.button), false]));
e.preventDefault();
return false;
}
obj.m.mousedown = function (e) {
if (!obj.socket || (obj.State != 3)) return;
if (obj.mouseNagleTimer != null) { clearTimeout(obj.mouseNagleTimer); obj.mouseNagleTimer = null; }
var m = getMousePosition(e);
if ((m.x < 0) || (m.y < 0) || (m.x > obj.ScreenWidth) || (m.y > obj.ScreenHeight)) return;
if (obj.mouseNagleTimer != null) { clearTimeout(obj.mouseNagleTimer); obj.mouseNagleTimer = null; }
obj.socket.send(JSON.stringify(['mouse', m.x, m.y, mouseButtonMap(e.button), true]));
e.preventDefault();
return false;