From 170329f399465e56d048d2fc7e847302e9194ece Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 11 Jun 2020 12:15:18 -0700 Subject: [PATCH] Fixed RDP mouse wheel. --- public/mstsc/client.js | 9 +++++++-- public/mstsc/index.html | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/public/mstsc/client.js b/public/mstsc/client.js index dcc61be6..bb88f5b1 100644 --- a/public/mstsc/client.js +++ b/public/mstsc/client.js @@ -100,7 +100,10 @@ if (self.mouseNagleTimer != null) { clearTimeout(self.mouseNagleTimer); self.mouseNagleTimer = null; } var isHorizontal = false; var delta = e.detail; - var step = Math.round(Math.abs(delta) * 15 / 8); + //var step = Math.round(Math.abs(delta) * 15 / 8); + //var step = Math.abs(e.detail); + var step = 128; + //console.log('DOMMouseScroll', delta, step, e.detail); var rect = e.target.getBoundingClientRect(); self.socket.send(JSON.stringify(['wheel', e.clientX - rect.left, e.clientY - rect.top, step, delta > 0, isHorizontal])); e.preventDefault(); @@ -111,7 +114,9 @@ if (self.mouseNagleTimer != null) { clearTimeout(self.mouseNagleTimer); self.mouseNagleTimer = null; } var isHorizontal = Math.abs(e.deltaX) > Math.abs(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); + var step = 128; + //console.log('mousewheel', delta, step, e); var rect = e.target.getBoundingClientRect(); self.socket.send(JSON.stringify(['wheel', e.clientX - rect.left, e.clientY - rect.top, step, delta > 0, isHorizontal])); e.preventDefault(); diff --git a/public/mstsc/index.html b/public/mstsc/index.html index d558b29d..9c7225d1 100644 --- a/public/mstsc/index.html +++ b/public/mstsc/index.html @@ -86,7 +86,6 @@ QV('main', false); canvas.width = window.innerWidth; canvas.height = window.innerHeight; - console.log('CanvasSize', canvas.width, canvas.height); client.connect(urlargs.ws, domain, username, password, function (err) { QV('myCanvas', false); QV('main', true); }); return false; }