Added ESC key when in browser full screen.

Ylian Saint-Hilaire committed Oct 26, 2020 at 13:17 UTC 20ca2f75950c26b8183038bb02d9364d829666be
2 files changed +14 -1
public/scripts/agent-desktop-0.0.2.js
-1
@@ -387,7 +387,6 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
387 }
388
389 obj.SendKeyMsgKC = function (action, kc) {
390 - //console.log('SendKeyMsgKC', action, kc);
390 if (obj.State != 3) return;
391 if (typeof action == 'object') { for (var i in action) { obj.SendKeyMsgKC(action[i][0], action[i][1]); } }
392 else {
views/default.handlebars
+14
@@ -638,6 +638,7 @@
638 <option value=12>Win+Right</option>
639 </select>
640 <input id="DeskWD" type=button value="Send" onkeypress="return false" onkeydown="return false" onclick="deskSendKeys()" />
641 + <input id="DeskESC" style="display:none" type="button" value="ESC" onkeypress="return false" onkeydown="return false" onclick="sendDeskEsc()" />
642 <input id="DeskClip" style="" type="button" value="Clipboard" onkeypress="return false" onkeydown="return false" onclick="showDeskClip()" />
643 <input id="DeskType" style="" type="button" value="Type" onkeypress="return false" onkeydown="return false" onclick="showDeskType()" />
644 <label><span id="DeskControlSpan" title="Toggle mouse and keyboard input"><input id="DeskControl" type="checkbox" onkeypress="return false" onkeydown="return false" onclick="toggleKvmControl()" />Input</span></label>&nbsp;
@@ -1381,6 +1382,8 @@
1382 window.onresize = function () {
1383 hideContextMenu();
1384 mainUpdate(512);
1385 + browserfullscreen = isBrowserFullscreen();
1386 + QV('DeskESC', browserfullscreen);
1387 if ((xtermfit != null) && (xxcurrentView == 12)) { xtermfit.fit(); }
1388 }
1389 setTimeout(function() { mainUpdate(512); }, 200);
@@ -6630,6 +6633,7 @@
6633 QV('deskFocusBtn', (desktop != null) && (desktop.contype == 2) && (deskState != 0) && (desktopsettings.showfocus));
6634 QV('DeskClip', (currentNode.agent) && (currentNode.agent.id != 11) && (currentNode.agent.id != 16) && ((desktop == null) || (desktop.contype != 2))); // Clipboard not supported on macOS
6635 QE('DeskClip', deskState == 3);
6636 + QE('DeskESC', deskState == 3);
6637 QE('DeskType', deskState == 3);
6638 QV('DeskWD', inputAllowed);
6639 QE('DeskWD', deskState == 3);
@@ -7110,6 +7114,16 @@
7114 QS(cv.id)['margin-top'] = '0';
7115 QS(cv.id)['margin-bottom'] = '0';
7116 }
7117 +
7118 + // Press ESC key
7119 + function sendDeskEsc() {
7120 + if (desktop == null || desktop.State != 3) return;
7121 + if (desktop.contype == 2) {
7122 + desktop.m.sendkey([[65307,1],[65307,0]]); // Intel AMT: ESC down, ESC release
7123 + } else {
7124 + desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,27], [desktop.m.KeyAction.EXUP,27]]); // MeshAgent: ESC press, ESC release
7125 + }
7126 + }
7127
7128 // Remote desktop special key combos for Windows
7129 function deskSendKeys() {