From 20ca2f75950c26b8183038bb02d9364d829666be Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Mon, 26 Oct 2020 13:17:10 -0700 Subject: [PATCH] Added ESC key when in browser full screen. --- public/scripts/agent-desktop-0.0.2.js | 1 - views/default.handlebars | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/public/scripts/agent-desktop-0.0.2.js b/public/scripts/agent-desktop-0.0.2.js index a6d0962a..9d700f7d 100644 --- a/public/scripts/agent-desktop-0.0.2.js +++ b/public/scripts/agent-desktop-0.0.2.js @@ -387,7 +387,6 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) { } obj.SendKeyMsgKC = function (action, kc) { - //console.log('SendKeyMsgKC', action, kc); if (obj.State != 3) return; if (typeof action == 'object') { for (var i in action) { obj.SendKeyMsgKC(action[i][0], action[i][1]); } } else { diff --git a/views/default.handlebars b/views/default.handlebars index b6eb4077..d19229c2 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -638,6 +638,7 @@ +   @@ -1381,6 +1382,8 @@ window.onresize = function () { hideContextMenu(); mainUpdate(512); + browserfullscreen = isBrowserFullscreen(); + QV('DeskESC', browserfullscreen); if ((xtermfit != null) && (xxcurrentView == 12)) { xtermfit.fit(); } } setTimeout(function() { mainUpdate(512); }, 200); @@ -6630,6 +6633,7 @@ QV('deskFocusBtn', (desktop != null) && (desktop.contype == 2) && (deskState != 0) && (desktopsettings.showfocus)); QV('DeskClip', (currentNode.agent) && (currentNode.agent.id != 11) && (currentNode.agent.id != 16) && ((desktop == null) || (desktop.contype != 2))); // Clipboard not supported on macOS QE('DeskClip', deskState == 3); + QE('DeskESC', deskState == 3); QE('DeskType', deskState == 3); QV('DeskWD', inputAllowed); QE('DeskWD', deskState == 3); @@ -7110,6 +7114,16 @@ QS(cv.id)['margin-top'] = '0'; QS(cv.id)['margin-bottom'] = '0'; } + + // Press ESC key + function sendDeskEsc() { + if (desktop == null || desktop.State != 3) return; + if (desktop.contype == 2) { + desktop.m.sendkey([[65307,1],[65307,0]]); // Intel AMT: ESC down, ESC release + } else { + desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,27], [desktop.m.KeyAction.EXUP,27]]); // MeshAgent: ESC press, ESC release + } + } // Remote desktop special key combos for Windows function deskSendKeys() {