diff --git a/public/scripts/agent-rdp-0.0.1.js b/public/scripts/agent-rdp-0.0.1.js index 41412436..36740295 100644 --- a/public/scripts/agent-rdp-0.0.1.js +++ b/public/scripts/agent-rdp-0.0.1.js @@ -198,6 +198,7 @@ var CreateRDPDesktop = function (canvasid) { if (obj.mouseNagleTimer != null) { clearTimeout(obj.mouseNagleTimer); obj.mouseNagleTimer = null; } var delta = 0; if (e.detail) { delta = (e.detail * 120); } else if (e.wheelDelta) { delta = (e.wheelDelta * 3); } + if (obj.m.ReverseMouseWheel) { delta = -1 * delta; } // Reverse the mouse wheel if (delta != 0) { obj.socket.send(JSON.stringify(['wheel', m.x, m.y, delta, false, false])); } e.preventDefault(); return false; diff --git a/views/default.handlebars b/views/default.handlebars index d9d0f835..1066c302 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -1379,6 +1379,7 @@ + @@ -8594,6 +8595,7 @@ desktop.m.onScreenSizeChange = mdeskAdjust; desktop.m.onClipboardChanged = function(text) { if ((text != null) && (desktopsettings.rdpautoclipboard) && (navigator.clipboard != null)) { navigator.clipboard.writeText(text).then(function() { }).catch(function(err) { console.log(err); }) } } // Put remote clipboard data into our clipboard if (desktopsettings.rdpsmb) { desktop.m.SwapMouse = desktopsettings.rdpsmb; } + if (desktopsettings.rdprmw) { desktop.m.ReverseMouseWheel = desktopsettings.rdprmw; } desktop.Start(desktopNode._id, currentNode.rdpport ? currentNode.rdpport : 3389, tsid); desktop.contype = 4; desktop.onConsoleMessageChange = function () { @@ -8882,6 +8884,7 @@ desktopsettings.localkeymap = d7localKeyMap.checked; desktopsettings.rdpsize = d7rdpsize.value; desktopsettings.rdpsmb = d7rdpsmb.checked; + desktopsettings.rdprmw = d7rdprmw.checked; desktopsettings.rdpautoclipboard = d7rdpclip.checked; var rdpflags = 0; for (var i = 1; i < 10; i++) { if ((i != 5) && (Q('d7rdp' + i).checked)) { rdpflags |= (1 << (i - 1)); } } @@ -8902,6 +8905,10 @@ if (desktopsettings.showfocus == false) { desktop.m.focusmode = 0; deskFocusBtn.value = "All Focus"; } if (desktop.State != 0) { desktop.Stop(); setTimeout(function () { connectDesktop(null, 2); }, 50); } } + if (desktop.contype == 4) { + desktop.m.SwapMouse = desktopsettings.rdpsmb; + desktop.m.ReverseMouseWheel = desktopsettings.rdprmw; + } } } @@ -8925,6 +8932,7 @@ if (desktopsettings.rdpsize != null) { d7rdpsize.value = desktopsettings.rdpsize; } if (desktopsettings.rdpflags == null) { desktopsettings.rdpflags = 0x2F; } if (desktopsettings.rdpsmb != null) { d7rdpsmb.checked = desktopsettings.rdpsmb; } + if (desktopsettings.rdprmw != null) { d7rdprmw.checked = desktopsettings.rdprmw; } if (desktopsettings.rdpautoclipboard != null) { d7rdpclip.checked = desktopsettings.rdpautoclipboard; } for (var i = 1; i < 10; i++) { if (i != 5) { Q('d7rdp' + i).checked = ((desktopsettings.rdpflags & (1 << (i - 1))) != 0); } } }