mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-14 00:04:59 -05:00
Improved RDP mouse and fixed French translation.
This commit is contained in:
parent
8058ea7180
commit
b4c6d34a80
@ -42,9 +42,18 @@
|
|||||||
this.render = new Mstsc.Canvas.create(this.canvas);
|
this.render = new Mstsc.Canvas.create(this.canvas);
|
||||||
this.socket = null;
|
this.socket = null;
|
||||||
this.activeSession = false;
|
this.activeSession = false;
|
||||||
|
this.mouseNagleTimer = null;
|
||||||
|
this.mouseNagleData = null;
|
||||||
this.install();
|
this.install();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
obj.mNagleTimer = setTimeout(function () {
|
||||||
|
obj.send(String.fromCharCode(5, obj.buttonmask) + ShortToStr(obj.mx) + ShortToStr(obj.my));
|
||||||
|
obj.mNagleTimer = null;
|
||||||
|
}, 50);
|
||||||
|
*/
|
||||||
|
|
||||||
Client.prototype = {
|
Client.prototype = {
|
||||||
install : function () {
|
install : function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
@ -53,12 +62,18 @@
|
|||||||
this.canvas.addEventListener('mousemove', function (e) {
|
this.canvas.addEventListener('mousemove', function (e) {
|
||||||
if (!self.socket || !self.activeSession) return;
|
if (!self.socket || !self.activeSession) return;
|
||||||
var rect = e.target.getBoundingClientRect();
|
var rect = e.target.getBoundingClientRect();
|
||||||
self.socket.send(JSON.stringify(['mouse', e.clientX - rect.left, e.clientY - rect.top, 0, false]));
|
self.mouseNagleData = ['mouse', e.clientX - rect.left, e.clientY - rect.top, 0, false];
|
||||||
|
if (self.mouseNagleTimer == null) {
|
||||||
|
//console.log('sending', self.mouseNagleData);
|
||||||
|
self.mouseNagleTimer = setTimeout(function () { self.socket.send(JSON.stringify(self.mouseNagleData)); self.mouseNagleTimer = null; }, 50);
|
||||||
|
}
|
||||||
|
//self.socket.send(JSON.stringify(this.mouseNagleData));
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
this.canvas.addEventListener('mousedown', function (e) {
|
this.canvas.addEventListener('mousedown', function (e) {
|
||||||
if (!self.socket || !self.activeSession) return;
|
if (!self.socket || !self.activeSession) return;
|
||||||
|
if (self.mouseNagleTimer != null) { clearTimeout(self.mouseNagleTimer); self.mouseNagleTimer = null; }
|
||||||
var rect = e.target.getBoundingClientRect();
|
var rect = e.target.getBoundingClientRect();
|
||||||
self.socket.send(JSON.stringify(['mouse', e.clientX - rect.left, e.clientY - rect.top, mouseButtonMap(e.button), true]));
|
self.socket.send(JSON.stringify(['mouse', e.clientX - rect.left, e.clientY - rect.top, mouseButtonMap(e.button), true]));
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -66,6 +81,7 @@
|
|||||||
});
|
});
|
||||||
this.canvas.addEventListener('mouseup', function (e) {
|
this.canvas.addEventListener('mouseup', function (e) {
|
||||||
if (!self.socket || !self.activeSession) return;
|
if (!self.socket || !self.activeSession) return;
|
||||||
|
if (self.mouseNagleTimer != null) { clearTimeout(self.mouseNagleTimer); self.mouseNagleTimer = null; }
|
||||||
var rect = e.target.getBoundingClientRect();
|
var rect = e.target.getBoundingClientRect();
|
||||||
self.socket.send(JSON.stringify(['mouse', e.clientX - rect.left, e.clientY - rect.top, mouseButtonMap(e.button), false]));
|
self.socket.send(JSON.stringify(['mouse', e.clientX - rect.left, e.clientY - rect.top, mouseButtonMap(e.button), false]));
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -73,6 +89,7 @@
|
|||||||
});
|
});
|
||||||
this.canvas.addEventListener('contextmenu', function (e) {
|
this.canvas.addEventListener('contextmenu', function (e) {
|
||||||
if (!self.socket || !self.activeSession) return;
|
if (!self.socket || !self.activeSession) return;
|
||||||
|
if (self.mouseNagleTimer != null) { clearTimeout(self.mouseNagleTimer); self.mouseNagleTimer = null; }
|
||||||
var rect = e.target.getBoundingClientRect();
|
var rect = e.target.getBoundingClientRect();
|
||||||
self.socket.send(JSON.stringify(['mouse', e.clientX - rect.left, e.clientY - rect.top, mouseButtonMap(e.button), false]));
|
self.socket.send(JSON.stringify(['mouse', e.clientX - rect.left, e.clientY - rect.top, mouseButtonMap(e.button), false]));
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -80,6 +97,7 @@
|
|||||||
});
|
});
|
||||||
this.canvas.addEventListener('DOMMouseScroll', function (e) {
|
this.canvas.addEventListener('DOMMouseScroll', function (e) {
|
||||||
if (!self.socket || !self.activeSession) return;
|
if (!self.socket || !self.activeSession) return;
|
||||||
|
if (self.mouseNagleTimer != null) { clearTimeout(self.mouseNagleTimer); self.mouseNagleTimer = null; }
|
||||||
var isHorizontal = false;
|
var isHorizontal = false;
|
||||||
var delta = e.detail;
|
var delta = e.detail;
|
||||||
var step = Math.round(Math.abs(delta) * 15 / 8);
|
var step = Math.round(Math.abs(delta) * 15 / 8);
|
||||||
@ -90,6 +108,7 @@
|
|||||||
});
|
});
|
||||||
this.canvas.addEventListener('mousewheel', function (e) {
|
this.canvas.addEventListener('mousewheel', function (e) {
|
||||||
if (!self.socket || !self.activeSession) return;
|
if (!self.socket || !self.activeSession) return;
|
||||||
|
if (self.mouseNagleTimer != null) { clearTimeout(self.mouseNagleTimer); self.mouseNagleTimer = null; }
|
||||||
var isHorizontal = Math.abs(e.deltaX) > Math.abs(e.deltaY);
|
var isHorizontal = Math.abs(e.deltaX) > Math.abs(e.deltaY);
|
||||||
var delta = isHorizontal?e.deltaX:e.deltaY;
|
var delta = isHorizontal?e.deltaX:e.deltaY;
|
||||||
var step = Math.round(Math.abs(delta) * 15 / 8);
|
var step = Math.round(Math.abs(delta) * 15 / 8);
|
||||||
|
@ -8236,7 +8236,7 @@
|
|||||||
{
|
{
|
||||||
"en": "Device Message",
|
"en": "Device Message",
|
||||||
"nl": "Apparaatbericht",
|
"nl": "Apparaatbericht",
|
||||||
"fr": "Message de Service\r\n",
|
"fr": "Message de Service",
|
||||||
"xloc": [
|
"xloc": [
|
||||||
"default.handlebars->27->629"
|
"default.handlebars->27->629"
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user