diff --git a/apprelays.js b/apprelays.js index a642718c..037ff361 100644 --- a/apprelays.js +++ b/apprelays.js @@ -291,6 +291,21 @@ module.exports.CreateMstscRelay = function (parent, db, ws, req, args, domain) { case 'wheel': { if (rdpClient) { rdpClient.sendWheelEvent(msg[1], msg[2], msg[3], msg[4]); } break; } case 'scancode': { if (rdpClient) { rdpClient.sendKeyEventScancode(msg[1], msg[2]); } break; } case 'unicode': { if (rdpClient) { rdpClient.sendKeyEventUnicode(msg[1], msg[2]); } break; } + case 'utype': { + if (!rdpClient) return; + obj.utype = msg[1]; + if (obj.utypetimer == null) { + obj.utypetimer = setInterval(function () { + if ((obj.utype == null) || (obj.utype.length == 0)) { clearInterval(obj.utypetimer); obj.utypetimer = null; return; } + var c = obj.utype.charCodeAt(0); + obj.utype = obj.utype.substring(1); + if (c == 13) return; + if (c == 10) { rdpClient.sendKeyEventScancode(28, true); rdpClient.sendKeyEventScancode(28, false); } + else { rdpClient.sendKeyEventUnicode(c, true); rdpClient.sendKeyEventUnicode(c, false); } + }, 5); + } + break; + } case 'ping': { try { obj.wsClient.send('{"ctrlChannel":102938,"type":"ping"}'); } catch (ex) { } break; } case 'pong': { try { obj.wsClient.send('{"ctrlChannel":102938,"type":"pong"}'); } catch (ex) { } break; } case 'disconnect': { obj.close(); break; } diff --git a/public/scripts/agent-rdp-0.0.1.js b/public/scripts/agent-rdp-0.0.1.js index 4daa67a1..f65e3813 100644 --- a/public/scripts/agent-rdp-0.0.1.js +++ b/public/scripts/agent-rdp-0.0.1.js @@ -174,9 +174,13 @@ var CreateRDPDesktop = function (canvasid) { e.preventDefault(); return false; } + obj.m.SendStringUnicode = function (txt) { + if (!obj.socket || (obj.State != 3)) return; + obj.socket.send(JSON.stringify(['utype', txt])); + } obj.m.mousedblclick = function () { } obj.m.handleKeyPress = function () { } obj.m.setRotation = function () { } - + return obj; } diff --git a/views/default.handlebars b/views/default.handlebars index 25f5eea3..3288f498 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -8330,7 +8330,7 @@ QV('DeskClip', (inputAllowed) && (currentNode.agent) && ((features2 & 0x1800) != 0x1800) && (currentNode.agent.id != 11) && (currentNode.agent.id != 16) && ((desktop == null) || (desktop.contype != 2)) && ((desktopsettings.autoclipboard != true) || (navigator.clipboard == null) || (navigator.clipboard.readText == null))); // Clipboard not supported on macOS QE('DeskESC', (deskState == 3) && (desktop.contype != 4)); QV('DeskESC', browserfullscreen && inputAllowed); - QE('DeskType', (deskState == 3) && (desktop.contype != 4)); + QE('DeskType', (deskState == 3)); // && (desktop.contype != 4) QV('DeskType', inputAllowed); QE('DeskWD', (deskState == 3) && (desktop.contype != 4)); QV('DeskWD', inputAllowed); @@ -9260,6 +9260,9 @@ if (desktop) { desktop.m.sendkey(key[0], key[1]); } if ((desktop == null) || (AmtDeskTypeContent.length == 0)) { clearInterval(AmtDeskTypeTimer); AmtDeskTypeContent = null; } }, 10); + } else if (desktop.contype == 4) { + // RDP + desktop.m.SendStringUnicode(txt); } else { // MeshAgent if (desktopsettings.remotekeymap !== true) {