1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Fixed keyboard input on desktop sharing.

This commit is contained in:
Ylian Saint-Hilaire 2020-08-11 10:39:06 -07:00
parent 28c2212507
commit 6b8a68ac61
61 changed files with 54 additions and 60 deletions

View file

@ -174,6 +174,9 @@
function start() {
window.onresize = deskAdjust;
document.onkeypress = ondockeypress;
document.onkeydown = ondockeydown;
document.onkeyup = ondockeyup;
setupDesktop();
}
@ -802,6 +805,57 @@
}
}
function ondockeypress(e) {
setSessionActivity();
if (!xxdialogMode && desktop && Q('DeskControl').checked) {
// Check what keys we are allows to send
/*
if (currentNode != null) {
var meshrights = GetNodeRights(currentNode);
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 ondockeydown(e) {
setSessionActivity();
if (!xxdialogMode && desktop && Q('DeskControl').checked) {
// Check what keys we are allows to send
/*
if (currentNode != null) {
var meshrights = GetNodeRights(currentNode);
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 ondockeyup(e) {
setSessionActivity();
if (!xxdialogMode && desktop && Q('DeskControl').checked) {
// Check what keys we are allows to send
/*
if (currentNode != null) {
var meshrights = GetNodeRights(currentNode);
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);
}
}
// Remote desktop typing
function showDeskType() {
if (xxdialogMode || desktop == null || desktop.State != 3) return;