diff --git a/package.json b/package.json index 51f47f90..ce32ebd8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.3.8-e", + "version": "0.3.8-f", "keywords": [ "Remote Management", "Intel AMT", diff --git a/views/default-mobile-min.handlebars b/views/default-mobile-min.handlebars index 5fc51682..ffb60084 100644 --- a/views/default-mobile-min.handlebars +++ b/views/default-mobile-min.handlebars @@ -1 +1 @@ - {{{title}}}
{{{title}}}
{{{title2}}}
\ No newline at end of file + {{{title}}}
{{{title}}}
{{{title2}}}
\ No newline at end of file diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index f1b18abf..5ce60359 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -362,6 +362,7 @@
  +
@@ -395,10 +396,11 @@
- - - - + + + + +
@@ -1523,6 +1525,57 @@ // MY DEVICES // + function ondeskkeypress(e) { + Q('DeskSoftInput').value = ''; + setSessionActivity(); + if (desktop && !xxdialogMode && xxcurrentView == 10) { + // Check what keys we are allows to send + if (currentNode != null) { + var mesh = meshes[currentNode.meshid]; + var meshrights = mesh.links[userinfo._id].rights; + var inputAllowed = ((meshrights == 0xFFFFFFFF) || (((meshrights & 8) != 0) && ((meshrights & 256) == 0))); + if (inputAllowed == false) return false; + var limitedInputAllowed = ((meshrights != 0xFFFFFFFF) && (((meshrights & 8) != 0) && ((meshrights & 256) == 0) && ((meshrights & 4096) != 0))); + if (limitedInputAllowed == true) { if ((e.altKey == true) || (e.ctrlKey == true) || ((e.keyCode < 32) && (e.keyCode != 8) && (e.keyCode != 13)) || (e.keyCode > 90)) return false; } + } + return desktop.m.handleKeys(e); + } + } + + function ondeskkeydown(e) { + Q('DeskSoftInput').value = ''; + setSessionActivity(); + if (desktop && !xxdialogMode && xxcurrentView == 10) { + // Check what keys we are allows to send + if (currentNode != null) { + var mesh = meshes[currentNode.meshid]; + var meshrights = mesh.links[userinfo._id].rights; + var inputAllowed = ((meshrights == 0xFFFFFFFF) || (((meshrights & 8) != 0) && ((meshrights & 256) == 0))); + if (inputAllowed == false) return false; + var limitedInputAllowed = ((meshrights != 0xFFFFFFFF) && (((meshrights & 8) != 0) && ((meshrights & 256) == 0) && ((meshrights & 4096) != 0))); + if (limitedInputAllowed == true) { if ((e.altKey == true) || (e.ctrlKey == true) || ((e.keyCode < 32) && (e.keyCode != 8) && (e.keyCode != 13)) || (e.keyCode > 90)) return false; } + } + return desktop.m.handleKeyDown(e); + } + } + + function ondeskkeyup(e) { + Q('DeskSoftInput').value = ''; + setSessionActivity(); + if (desktop && !xxdialogMode && xxcurrentView == 10) { + // Check what keys we are allows to send + if (currentNode != null) { + var mesh = meshes[currentNode.meshid]; + var meshrights = mesh.links[userinfo._id].rights; + var inputAllowed = ((meshrights == 0xFFFFFFFF) || (((meshrights & 8) != 0) && ((meshrights & 256) == 0))); + if (inputAllowed == false) return false; + var limitedInputAllowed = ((meshrights != 0xFFFFFFFF) && (((meshrights & 8) != 0) && ((meshrights & 256) == 0) && ((meshrights & 4096) != 0))); + if (limitedInputAllowed == true) { if ((e.altKey == true) || (e.ctrlKey == true) || ((e.keyCode < 32) && (e.keyCode != 8) && (e.keyCode != 13)) || (e.keyCode > 90)) return false; } + } + return desktop.m.handleKeyUp(e); + } + } + // Since the update device call can be quite frequent, we can moderate it and only call it at most 5 times a second. var updateDevicesTimer = null; function updateDevices() { if (updateDevicesTimer != null) return; updateDevicesTimer = setTimeout(updateDevicesEx, 200); } @@ -2222,7 +2275,7 @@ case 2: break; default: - console.log('Unknown onDesktopStateChange state', state); + //console.log('Unknown onDesktopStateChange state', state); break; } updateDesktopButtons(); @@ -2354,13 +2407,17 @@ } */ - /* // Send CTRL-ALT-DEL function sendCAD() { if (xxdialogMode || desktop == null || desktop.State != 3) return; desktop.m.sendcad(); } - */ + + // Toggle soft keyboard + function toggleSoftKeys(x) { + QV('DeskSoftInput', x == 1); + if (x == 1) { Q('DeskSoftInput').focus(); } + } // Show process dialogs function toggleDeskTools() { @@ -2426,10 +2483,10 @@ desktop.m.SetDisplay(display); } - function dmousedown(e) { setSessionActivity(); if ((!xxdialogMode && desktop != null) && Q('DeskControl').checked) desktop.m.mousedown(e) } - function dmouseup(e) { setSessionActivity(); if ((!xxdialogMode && desktop != null) && Q('DeskControl').checked) desktop.m.mouseup(e) } - function dmousemove(e) { setSessionActivity(); if ((!xxdialogMode && desktop != null) && Q('DeskControl').checked) desktop.m.mousemove(e) } - function dmousewheel(e) { setSessionActivity(); if ((!xxdialogMode && desktop != null) && Q('DeskControl').checked && desktop.m.mousewheel) { desktop.m.mousewheel(e); haltEvent(e); return true; } return false; } + function dmousedown(e) { setSessionActivity(); if ((!xxdialogMode && desktop != null)) desktop.m.mousedown(e) } + function dmouseup(e) { setSessionActivity(); if ((!xxdialogMode && desktop != null)) desktop.m.mouseup(e) } + function dmousemove(e) { setSessionActivity(); if ((!xxdialogMode && desktop != null)) desktop.m.mousemove(e) } + function dmousewheel(e) { setSessionActivity(); if ((!xxdialogMode && desktop != null) && desktop.m.mousewheel) { desktop.m.mousewheel(e); haltEvent(e); return true; } return false; } function drotate(x) { if (!xxdialogMode && desktop != null) { desktop.m.setRotation(desktop.m.rotation + x); deskAdjust(); deskAdjust(); } } function stopProcess(id, name) { setDialogMode(2, "Process Control", 3, stopProcessEx, 'Stop process #' + id + ' "' + name + '"?', id); } function stopProcessEx(buttons, tag) { meshserver.send({ action: 'msg', type: 'pskill', nodeid: currentNode._id, value: tag }); setTimeout(refreshDeskTools, 300); }