mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-22 12:52:50 +03:00
Added mouse button swap support.
This commit is contained in:
parent
a037cea400
commit
e97e3db8d3
2
public/scripts/agent-desktop-0.0.2-min.js
vendored
2
public/scripts/agent-desktop-0.0.2-min.js
vendored
File diff suppressed because one or more lines are too long
@ -43,6 +43,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
||||
obj.CompressionLevel = 50;
|
||||
obj.ScalingLevel = 1024;
|
||||
obj.FrameRateTimer = 100;
|
||||
obj.SwapMouse = false;
|
||||
obj.FirstDraw = false;
|
||||
|
||||
obj.ScreenWidth = 960;
|
||||
@ -467,6 +468,12 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
||||
if (event.detail) { Delta = (-1 * (event.detail * 120)); } else if (event.wheelDelta) { Delta = (event.wheelDelta * 3); }
|
||||
}
|
||||
|
||||
// Swap mouse buttons if needed
|
||||
if (obj.SwapMouse === true) {
|
||||
if (Button == obj.MouseButton.LEFT) { Button = obj.MouseButton.RIGHT; }
|
||||
else if (Button == obj.MouseButton.RIGHT) { Button = obj.MouseButton.LEFT; }
|
||||
}
|
||||
|
||||
var MouseMsg = "";
|
||||
if (Action == obj.KeyAction.DBLCLICK) {
|
||||
MouseMsg = String.fromCharCode(0x00, obj.InputType.MOUSE, 0x00, 0x0A, 0x00, 0x88, ((X / 256) & 0xFF), (X & 0xFF), ((Y / 256) & 0xFF), (Y & 0xFF));
|
||||
|
@ -26069,6 +26069,7 @@
|
||||
"zh-cht": "其他設定",
|
||||
"xloc": [
|
||||
"default.handlebars->container->dialog->dialogBody->dialog7->d7amtkvm->5->1",
|
||||
"default.handlebars->container->dialog->dialogBody->dialog7->d7meshkvm->d7desktopOtherSettings->1",
|
||||
"desktop.handlebars->p11->dialog->dialogBody->dialog7->d7amtkvm->5->1"
|
||||
]
|
||||
},
|
||||
@ -34592,6 +34593,12 @@
|
||||
"default.handlebars->27->1201"
|
||||
]
|
||||
},
|
||||
{
|
||||
"en": "Swap Mouse Buttons",
|
||||
"xloc": [
|
||||
"default.handlebars->container->dialog->dialogBody->dialog7->d7meshkvm->d7desktopOtherSettings->d7otherset2->1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cs": "švédština",
|
||||
"de": "Schwedisch",
|
||||
|
@ -1171,6 +1171,12 @@
|
||||
<option value=1000>Very slow</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="d7desktopOtherSettings">
|
||||
<div>Other Settings</div>
|
||||
<div id="d7otherset2" style="display:block">
|
||||
<label style="display:block"><input type="checkbox" id="d7deskSwapMouse" />Swap Mouse Buttons</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="d7amtkvm">
|
||||
<h4>Intel® AMT Hardware KVM</h4>
|
||||
@ -1240,7 +1246,7 @@
|
||||
var stars = {}; // Devices that have been "stared" by the user.
|
||||
var nodeShortIdent = 0;
|
||||
var desktop;
|
||||
var desktopsettings = { encoding: 2, showfocus: false, showmouse: true, showcad: true, quality: 40, scaling: 1024, framerate: 50, localkeymap: false };
|
||||
var desktopsettings = { encoding: 2, showfocus: false, showmouse: true, showcad: true, quality: 40, scaling: 1024, framerate: 50, localkeymap: false, swapmouse: false };
|
||||
var multidesktopsettings = { quality: 20, scaling: 128, framerate: 1000 };
|
||||
var terminal;
|
||||
var files;
|
||||
@ -3849,6 +3855,7 @@
|
||||
function showMultiDesktopSettings() {
|
||||
QV('d7amtkvm', false);
|
||||
QV('d7meshkvm', true);
|
||||
QV('d7desktopOtherSettings', false);
|
||||
d7bitmapquality.value = multidesktopsettings.quality;
|
||||
d7bitmapscaling.value = multidesktopsettings.scaling;
|
||||
if (multidesktopsettings.framerate) { d7framelimiter.value = multidesktopsettings.framerate; } else { d7framelimiter.value = 100; }
|
||||
@ -3896,6 +3903,7 @@
|
||||
desk.m.CompressionLevel = multidesktopsettings.quality;
|
||||
desk.m.ScalingLevel = multidesktopsettings.scaling;
|
||||
if (multidesktopsettings.framerate) { desk.m.FrameRateTimer = multidesktopsettings.framerate; }
|
||||
if (multidesktopsettings.swapmouse) { desk.m.SwapMouse = multidesktopsettings.swapmouse; }
|
||||
//desk.m.onDisplayinfo = deskDisplayInfo;
|
||||
//desk.m.onScreenSizeChange = deskAdjust;
|
||||
if (debugmode > 0) { desk.m.onScreenSizeChange = mdeskAdjust; } // Multi-Desktop Adjust
|
||||
@ -6725,6 +6733,7 @@
|
||||
desktop.m.CompressionLevel = desktopsettings.quality; // Number from 1 to 100. 50 or less is best.
|
||||
desktop.m.ScalingLevel = desktopsettings.scaling;
|
||||
if (desktopsettings.framerate) { desktop.m.FrameRateTimer = desktopsettings.framerate; }
|
||||
if (desktopsettings.swapmouse) { desktop.m.SwapMouse = desktopsettings.swapmouse; }
|
||||
desktop.m.onDisplayinfo = deskDisplayInfo;
|
||||
desktop.m.onScreenSizeChange = deskAdjust;
|
||||
desktop.Start(desktopNode._id);
|
||||
@ -6878,11 +6887,13 @@
|
||||
desktopsettings.quality = d7bitmapquality.value;
|
||||
desktopsettings.scaling = d7bitmapscaling.value;
|
||||
desktopsettings.framerate = d7framelimiter.value;
|
||||
desktopsettings.swapmouse = d7deskSwapMouse.checked;
|
||||
desktopsettings.localkeymap = d7localKeyMap.checked;
|
||||
localStorage.setItem('desktopsettings', JSON.stringify(desktopsettings));
|
||||
applyDesktopSettings();
|
||||
if (desktop) {
|
||||
if (desktop.contype == 1) {
|
||||
desktop.m.SwapMouse = desktopsettings.swapmouse;
|
||||
if (desktop.State != 0) {
|
||||
desktop.m.SendCompressionLevel(1, desktopsettings.quality, desktopsettings.scaling, desktopsettings.framerate);
|
||||
}
|
||||
@ -6905,6 +6916,7 @@
|
||||
if (ops.indexOf(parseInt(desktopsettings.quality)) >= 0) { d7bitmapquality.value = desktopsettings.quality; }
|
||||
d7bitmapscaling.value = desktopsettings.scaling;
|
||||
if (desktopsettings.framerate) { d7framelimiter.value = desktopsettings.framerate; } else { d7framelimiter.value = 100; }
|
||||
if (desktopsettings.swapmouse != null) { d7deskSwapMouse.checked = desktopsettings.swapmouse; }
|
||||
if (desktopsettings.localkeymap) { d7localKeyMap.checked = desktopsettings.localkeymap; }
|
||||
QV('deskFocusBtn', (desktop != null) && (desktop.contype == 2) && (desktop.state != 0) && (desktopsettings.showfocus));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user