Added customized keyboard shortcuts on mobile site.

Ylian Saint-Hilaire committed Jan 8, 2021 at 16:03 UTC 1aa934006e7b1d925526b554e1781a83e14e6940
2 files changed +200 -122
views/default-mobile.handlebars
+193 -103
@@ -658,6 +658,14 @@
658 </td>
659 </tr>
660 </table>
661 + <div id=p10dialog style="z-index:1000;background-color:#EEE;box-shadow:0px 0px 15px #666;font-family:Arial,Helvetica,sans-serif;border-radius:5px;position:fixed;top:30px;width:300px;left:30px;display:none">
662 + <div style="width:100%;background-color:#003366;color:#FFF;border-radius:5px 5px 0 0">
663 + <div style=padding:5px>Keyboard Shortcuts Customization</div>
664 + <div style=width:100%;margin:6px></div>
665 + </div>
666 + <div style="margin-right:16px;margin-left:8px"><div id=p10dialog2 style="margin:auto;margin:3px"></div></div>
667 + <div style="padding:10px;margin-bottom:20px"><input type="button" value="OK" style="float:right;width:80px" onclick="deskCustomizeKeysEx()"></div>
668 + </div>
669 <div id=p10general style="overflow-y:scroll;position:absolute;top:55px;bottom:0px;width:100%">
670 <div class="deviceNotifyLargeDot">
671 <img id="p10deviceStar" class=deviceNotifyLargeDotSub src=images/icon-star-notify-40.png width=35 height=35>
@@ -670,7 +678,6 @@
678 <div id=p10html2></div>
679 <div id=p10html3></div>
680 </div>
673 -
681 <img id="deskkeybutton1" src="images/mobile-desk-exit.png" class="deskButton" style="top:10px;display:none" onclick="exitButton()" />
682 <img id="deskkeybutton3a" src="images/mobile-desk-menu-open.png" class="deskButton" style="top:60px;display:none" onclick="toggleMenu(false)" />
683 <img id="deskkeybutton3b" src="images/mobile-desk-menu-close.png" class="deskButton" style="top:60px;display:none" onclick="toggleMenu(true)" />
@@ -683,22 +690,7 @@
690 <div style="position:absolute;top:0;left:0;z-index:200;opacity:0;width:1px;height:1px">
691 <input id="softKeyboard" autocomplete="off" type="password" style="z-index:200;opacity:0;width:1px;height:1px" onfocus="keyboardFocusChange()" onblur="keyboardFocusChange()" onkeypress="return ondeskkeypress(event)" onkeydown="return ondeskkeydown(event)" onkeyup="return ondeskkeyup(event)" />
692 </div>
686 - <div id="deskButtonMenu" style="display:none;position:absolute;top:10px;left:10px;right:55px;bottom:10px;z-index:1000">
687 - <div class="menuButton" onclick="deskMenuButton(0x100000)">Win</div>
688 - <div class="menuButton" onclick="deskMenuButton(0x0A0053)">Ctrl-Alt-Del</div>
689 - <div class="menuButton" onclick="deskMenuButton(0x00001B)">ESC</div>
690 - <div class="menuButton" onclick="deskMenuButton(0x100028)">WIN + Down</div>
691 - <div class="menuButton" onclick="deskMenuButton(0x100026)">WIN + Up</div>
692 - <div class="menuButton" onclick="deskMenuButton(0x10004C)">WIN + L</div>
693 - <div class="menuButton" onclick="deskMenuButton(0x10004D)">WIN + M</div>
694 - <div class="menuButton" onclick="deskMenuButton(0x11004D)">Shift + WIN + M</div>
695 - <div class="menuButton" onclick="deskMenuButton(0x100052)">WIN + R</div>
696 - <div class="menuButton" onclick="deskMenuButton(0x020073)">ALT + F4</div>
697 - <div class="menuButton" onclick="deskMenuButton(0x080057)">CTRL + W</div>
698 - <div class="menuButton" onclick="deskMenuButton(0x020009)">ALT + TAB</div>
699 - <div class="menuButton" onclick="deskMenuButton(0x000009)">TAB</div>
700 - <div class="menuButton" onclick="deskMenuButton(0x010079)">Shift + F10</div>
701 - </div>
693 + <div id="deskButtonMenu" style="display:none;position:absolute;top:10px;left:10px;right:55px;bottom:10px;z-index:1000"></div>
694 <div id=p10desktop style="overflow:hidden;position:absolute;top:55px;bottom:0px;width:100%;display:none">
695 <div id=deskarea1 style="position:absolute;top:0px;width:100%;height:32px">
696 <div style="padding-top:2px;padding-bottom:2px;background:#C0C0C0;height:32px">
@@ -982,6 +974,7 @@
974 if (passRequirements != '') { passRequirements = JSON.parse(decodeURIComponent(passRequirements)); }
975 var sessionActivity = Date.now();
976 var deskPinchZoom;
977 + var deskKeyboardShortcuts = [];
978
979 function startup() {
980 if ((features & 32) == 0) {
@@ -1028,6 +1021,12 @@
1021
1022 // Session Refresh Timer
1023 if (sessionTime >= 10) { sessionRefreshTimer = setTimeout(refreshCookieSession, Math.round((sessionTime * 60000) * 0.8)); }
1024 +
1025 + // Set the user's desktop shortcut keys
1026 + deskKeyboardShortcuts = [];
1027 + var deskKeyboardShortcutsStr = getstore('deskKeyShortcuts', '0x0A002E,0x100000,0x100028,0x100026,0x10004C,0x10004D,0x11004D,0x100052,0x020073,0x080057,0x020009,0x100025,0x100027').split(',');
1028 + for (var i in deskKeyboardShortcutsStr) { deskKeyboardShortcuts.push(parseInt(deskKeyboardShortcutsStr[i])); }
1029 + updateDeskShortcutKeys();
1030 }
1031
1032 function refreshCookieSession() {
@@ -1348,6 +1347,14 @@
1347 if (Q('SearchInput').value == '*') { onSearchInputChanged(); }
1348 }
1349 if (currentNode) { refreshDevice(currentNode._id); }
1350 +
1351 + // Set the user's desktop shortcut keys
1352 + if (webstate.deskKeyShortcuts != null) {
1353 + deskKeyboardShortcuts = [];
1354 + var deskKeyboardShortcutsStr = webstate.deskKeyShortcuts.split(',');
1355 + for (var i in deskKeyboardShortcutsStr) { deskKeyboardShortcuts.push(parseInt(deskKeyboardShortcutsStr[i])); }
1356 + updateDeskShortcutKeys();
1357 + }
1358 }
1359 break;
1360 }
@@ -3328,6 +3335,7 @@
3335 var keyboardShownTimer = null;
3336 var fullScreenMode = false;
3337 function toggleKeyboard() {
3338 + if (xxdialogMode) return;
3339 if (keyboardShownTimer != null) { clearTimeout(keyboardShownTimer); }
3340 if (keyboardShown) { Q('softKeyboard').blur(); keyboardShown = false; } else { Q('softKeyboard').focus(); keyboardShown = true; }
3341 QV('deskkeybutton2a', fullscreen && !keyboardShown);
@@ -3352,6 +3360,7 @@
3360 }
3361
3362 function exitButton() {
3363 + if (xxdialogMode) return;
3364 QV('deskButtonMenu', false);
3365 deskToggleFull();
3366 }
@@ -3364,15 +3373,180 @@
3373 fullScreenMode = false;
3374 }
3375
3367 - function deskMenuButton(x) { toggleMenu(true); deskSendKeys(x); }
3376 + function deskMenuButton(x) {
3377 + toggleMenu(true);
3378 + deskSendKeys(x);
3379 + }
3380 +
3381 + //
3382 + // Desktop Shortcut Keys
3383 + //
3384 +
3385 + function updateDeskShortcutKeys() {
3386 + var x = '<div class="menuButton" onclick="deskMenuButton(-1)">' + "Customize" + '</div>';
3387 + for (var i in deskKeyboardShortcuts) { x += '<div class="menuButton" onclick="deskMenuButton(' + deskKeyboardShortcuts[i] + ')">' + keyShortcutTotext(deskKeyboardShortcuts[i]) + '</div>'; }
3388 + QH('deskButtonMenu', x);
3389 + }
3390 +
3391 + var keyStrings = { 8: "BackSpace", 9: "Tab", 13: "Enter", 27: "Escape", 45: "Insert", 46: "Del", 36: "Home", 35: "End", 33: "Page Up", 34: "Page Down", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 0: "None" }
3392 +
3393 + function keyShortcutTotext(n) {
3394 + var x = [];
3395 + if (n & 0x010000) { x.push("Shift"); }
3396 + if (n & 0x020000) { x.push("Alt"); }
3397 + if (n & 0x080000) { x.push("Ctrl"); }
3398 + if (n & 0x100000) { x.push("Win"); }
3399 + n = (n & 0xFFFF);
3400 + if ((n >= 112) && (n <= 123)) { x.push('F' + (n - 111)); } // Fx keys
3401 + else if ((n != 0) && (keyStrings[n])) { x.push(keyStrings[n]); }
3402 + else { if (n != 0) { x.push(String.fromCharCode(n)); } }
3403 + return x.join(' + ');
3404 + }
3405 +
3406 + // Customize keyboard shortcuts
3407 + function deskCustomizeKeys() {
3408 + if (xxdialogMode) return;
3409 + var x = '<div id=d2shortcuts style="width:100%;height:180px;padding:4px;overflow-y:auto;border:1px solid gray"></div><div style=width:100%;padding:5px>';
3410 + x += '<label><input id=d1kshift type=checkbox /> ' + "Shift" + '</label><label> <input id=d1kalt type=checkbox /> ' + "Alt" + '</label><label> <input id=d1kctrl type=checkbox /> ' + "Ctrl" + '</label> <input id=d1kwin type=checkbox /> ' + "Win" + '</label>';
3411 + x += ' <select id=d2keySelect>';
3412 + for (var i in keyStrings) { x += '<option value=' + i + '>' + keyStrings[i] + '</option>'; }
3413 + for (var i = 1; i <= 12; i++) { x += '<option value=' + (i + 111) + '>F' + i + '</option>'; }
3414 + for (var i = 0; i < 10; i++) { x += '<option value=' + (i + 48) + '>' + i + '</option>'; }
3415 + for (var i = 0; i < 26; i++) { x += '<option value=' + (i + 65) + '>' + String.fromCharCode(i + 65) + '</option>'; }
3416 + x += '</select> <input type=button value=' + "Add" + ' onclick=addDeskCustomizeKey() /></div>';
3417 + QH('p10dialog2', x);
3418 + xxdialogMode = 2;
3419 + QV('p10dialog', true);
3420 + deskUpdateShortcutList();
3421 + }
3422 +
3423 + function deskCustomizeKeysEx() {
3424 + QV('p10dialog', false);
3425 + xxdialogMode = 0;
3426 + putstore('deskKeyShortcuts', deskKeyboardShortcuts.join(','));
3427 + updateDeskShortcutKeys();
3428 + }
3429 +
3430 + function deskUpdateShortcutList() {
3431 + var x = '';
3432 + for (var i in deskKeyboardShortcuts) {
3433 + var kt = keyShortcutTotext(deskKeyboardShortcuts[i]), orderButtons = '';
3434 + if (i != (deskKeyboardShortcuts.length - 1)) { orderButtons += '<img width=8 height=8 style=float:right;cursor:pointer;padding:3px src="images/c2.png" onclick=deskCustomizeKeyDown(' + deskKeyboardShortcuts[i] + ')>'; }
3435 + if (i != 0) { orderButtons += '<img width=8 height=8 style=float:right;cursor:pointer;padding:3px src="images/c3.png" onclick=deskCustomizeKeyUp(' + deskKeyboardShortcuts[i] + ')>'; }
3436 + x += '<div style="width:100%;background-color:#AAA;border-radius:4px;margin-bottom:4px;padding:4px;text-align:left;box-sizing:border-box" value=' + deskKeyboardShortcuts[i] + '>' + kt + '<img width=10 height=10 style=float:right;cursor:pointer;padding:2px;margin-left:8px src="images/trash.png" onclick=removeDeskCustomizeKey(' + deskKeyboardShortcuts[i] + ')>' + orderButtons + '</div>';
3437 + }
3438 + if (x == '') { x = '<i>' + "No keyboard shortcuts defined" + '</i>'; }
3439 + QH('d2shortcuts', x);
3440 + }
3441 +
3442 + function deskCustomizeKeyDown(k) {
3443 + var i = deskKeyboardShortcuts.indexOf(k), x = deskKeyboardShortcuts[i + 1];
3444 + deskKeyboardShortcuts[i + 1] = deskKeyboardShortcuts[i];
3445 + deskKeyboardShortcuts[i] = x;
3446 + deskUpdateShortcutList();
3447 + }
3448 +
3449 + function deskCustomizeKeyUp(k) {
3450 + var i = deskKeyboardShortcuts.indexOf(k), x = deskKeyboardShortcuts[i];
3451 + deskKeyboardShortcuts[i] = deskKeyboardShortcuts[i - 1];
3452 + deskKeyboardShortcuts[i - 1] = x;
3453 + deskUpdateShortcutList();
3454 + }
3455 +
3456 + function removeDeskCustomizeKey(k) {
3457 + var na = [];
3458 + for (var i in deskKeyboardShortcuts) { if (deskKeyboardShortcuts[i] != k) { na.push(deskKeyboardShortcuts[i]); } }
3459 + deskKeyboardShortcuts = na;
3460 + deskUpdateShortcutList();
3461 + }
3462 +
3463 + function addDeskCustomizeKey() {
3464 + var k = parseInt(Q('d2keySelect').value);
3465 + if (Q('d1kshift').checked) { k |= 0x010000; }
3466 + if (Q('d1kalt').checked) { k |= 0x020000; }
3467 + if (Q('d1kctrl').checked) { k |= 0x080000; }
3468 + if (Q('d1kwin').checked) { k |= 0x100000; }
3469 + if ((k > 0) && (deskKeyboardShortcuts.indexOf(k) == -1)) { deskKeyboardShortcuts.push(k); deskUpdateShortcutList(); }
3470 + }
3471 +
3472 + // Remote desktop special key combos for Windows
3473 + function deskSendKeys(ks) {
3474 + if (xxdialogMode || desktop == null || desktop.State != 3) return;
3475 +
3476 + // Construct the key command
3477 + if (ks == -1) { deskCustomizeKeys(); return; } // Customize
3478 + if (ks == 0x0A002E) { desktop.m.sendcad(); return; } // CTRL-ALT-DEL
3479 + if ((desktop.contype == 1) && (ks == 0x100052)) { desktop.sendCtrlMsg('{"action":"lock"}'); return; } // Lock desktop
3480 +
3481 + var flags = (ks & 0xFF0000) >> 16, key = (ks & 0xFFFF), keyArray = [], keyArray2 = [];
3482 + var amtTranslate = {
3483 + 8: 0xff08, // BackSpace
3484 + 9: 0xff09, // Tab
3485 + 13: 0xff0d, // Return or Enter
3486 + 27: 0xff1b, // Escape
3487 + 45: 0xff63, // Insert
3488 + 46: 0xffff, // Delete
3489 + 36: 0xff50, // Home
3490 + 35: 0xff57, // End
3491 + 33: 0xff55, // Page Up
3492 + 34: 0xff56, // Page Down
3493 + 37: 0xff51, // Left arrow
3494 + 38: 0xff52, // Up arrow
3495 + 39: 0xff53, // Right arrow
3496 + 40: 0xff54, // Down arrow
3497 + 112: 0xffbe, // F1
3498 + 113: 0xffbf, // F2
3499 + 114: 0xffc0, // F3
3500 + 115: 0xffc1, // F4
3501 + 116: 0xffc2, // F5
3502 + 117: 0xffc3, // F6
3503 + 118: 0xffc4, // F7
3504 + 119: 0xffc5, // F8
3505 + 120: 0xffc6, // F9
3506 + 121: 0xffc7, // F10
3507 + 122: 0xffc8, // F11
3508 + 123: 0xffc9 // F12
3509 + }
3510 +
3511 + // 0x010000 = Shift
3512 + // 0x020000 = Left-Alt
3513 + // 0x080000 = Ctrl
3514 + // 0x100000 = Window
3515 +
3516 + if (desktop.contype == 2) {
3517 + // Intel AMT
3518 + if (flags & 1) { keyArray.push([0xffe1, 1]); keyArray2.push([0xffe1, 0]); } // Shift
3519 + if (flags & 2) { keyArray.push([0xffe9, 1]); keyArray2.push([0xffe9, 0]); } // Left-alt
3520 + if (flags & 8) { keyArray.push([0xffe3, 1]); keyArray2.push([0xffe3, 0]); } // Ctrl
3521 + if (flags & 16) { keyArray.push([0xffe7, 1]); keyArray2.push([0xffe7, 0]); } // Windows key
3522 + if (amtTranslate[key]) { key = amtTranslate[key]; }
3523 + if ((key >= 65) && (key <= 90)) { key += 32; }
3524 + if (key != 0) { keyArray.push([key, 1]); keyArray2.push([key, 0]); }
3525 + keyArray2.reverse();
3526 + for (var i = 0; i < keyArray2.length; i++) { keyArray.push(keyArray2[i]); }
3527 + desktop.m.sendkey(keyArray);
3528 + } else {
3529 + // Agent desktop
3530 + if (flags & 1) { keyArray.push([desktop.m.KeyAction.DOWN, 16]); keyArray2.push([desktop.m.KeyAction.UP, 16]); } // Shift
3531 + if (flags & 2) { keyArray.push([desktop.m.KeyAction.EXDOWN, 18]); keyArray2.push([desktop.m.KeyAction.EXUP, 18]); } // Left-alt
3532 + if (flags & 8) { keyArray.push([desktop.m.KeyAction.EXDOWN, 17]); keyArray2.push([desktop.m.KeyAction.EXUP, 17]); } // Ctrl
3533 + if (flags & 16) { keyArray.push([desktop.m.KeyAction.EXDOWN, 0x5B]); keyArray2.push([desktop.m.KeyAction.EXUP, 0x5B]); } // Windows key
3534 + if (key != 0) { keyArray.push([desktop.m.KeyAction.DOWN, key]); keyArray2.push([desktop.m.KeyAction.UP, key]); }
3535 + keyArray2.reverse();
3536 + for (var i = 0; i < keyArray2.length; i++) { keyArray.push(keyArray2[i]); }
3537 + desktop.m.SendKeyMsgKC(keyArray);
3538 + }
3539 + }
3540
3541 function toggleMenu(x) {
3542 + if (xxdialogMode) return;
3543 QV('deskButtonMenu', fullscreen && !x);
3544 QV('deskkeybutton3a', fullscreen && x);
3545 QV('deskkeybutton3b', fullscreen && !x);
3546 }
3547
3548 function deskChangeMouseButton(x) {
3549 + if (xxdialogMode) return;
3550 if (desktop == null) return;
3551 desktop.m.SwapMouse = !desktop.m.SwapMouse;
3552 QV('deskkeybutton4a', fullscreen && (!desktop.m.SwapMouse));
@@ -3380,6 +3554,7 @@
3554 }
3555
3556 function deskChangeFullscreenZoom() {
3557 + if (xxdialogMode) return;
3558 if (desktop == null) return;
3559 if (fullscreenzoom == 1) { fullscreenzoom = 0.5; } else { fullscreenzoom = 1; }
3560 QV('deskkeybutton5a', fullscreen && (fullscreenzoom == 1));
@@ -3480,91 +3655,6 @@
3655 }
3656 }
3657
3483 - // Remote desktop special key combos for Windows
3484 - function deskSendKeys(xkey) {
3485 - if (xxdialogMode || desktop == null || desktop.State != 3) return;
3486 -
3487 - // Construct the key command
3488 - var ks = xkey ? xkey : parseInt(Q('deskkeys').value);
3489 - if (ks == 0x0A0053) { desktop.m.sendcad(); return; } // CTRL-ALT-DEL
3490 - if ((desktop.contype == 1) && (ks == 0x100052)) { desktop.sendCtrlMsg('{"action":"lock"}'); return; } // Lock desktop
3491 -
3492 - var flags = (ks & 0xFF0000) >> 16, key = (ks & 0xFFFF), keyArray = [], keyArray2 = [];
3493 - var amtTranslate = {
3494 - 8: 0xff08, // BackSpace
3495 - 9: 0xff09, // Tab
3496 - 13: 0xff0d, // Return or Enter
3497 - 27: 0xff1b, // Escape
3498 - 45: 0xff63, // Insert
3499 - 46: 0xffff, // Delete
3500 - 36: 0xff50, // Home
3501 - 35: 0xff57, // End
3502 - 33: 0xff55, // Page Up
3503 - 34: 0xff56, // Page Down
3504 - 37: 0xff51, // Left arrow
3505 - 38: 0xff52, // Up arrow
3506 - 39: 0xff53, // Right arrow
3507 - 40: 0xff54, // Down arrow
3508 - 112: 0xffbe, // F1
3509 - 113: 0xffbf, // F2
3510 - 114: 0xffc0, // F3
3511 - 115: 0xffc1, // F4
3512 - 116: 0xffc2, // F5
3513 - 117: 0xffc3, // F6
3514 - 118: 0xffc4, // F7
3515 - 119: 0xffc5, // F8
3516 - 120: 0xffc6, // F9
3517 - 121: 0xffc7, // F10
3518 - 122: 0xffc8, // F11
3519 - 123: 0xffc9 // F12
3520 - }
3521 -
3522 - // 0x010000 = Shift
3523 - // 0x020000 = Left-Alt
3524 - // 0x080000 = Ctrl
3525 - // 0x100000 = Window
3526 -
3527 - // Examples:
3528 - // WIN+DOWN = 0x100028
3529 - // WIN+UP = 0x100026
3530 - // WIN+L = 0x10004C
3531 - // WIN+M = 0x10004D
3532 - // Shift+WIN+M = 0x11004D
3533 - // WIN = 0x100000
3534 - // WIN+R = 0x100052
3535 - // ALT+F4 = 0x020073
3536 - // CTRL+W = 0x080057
3537 - // ALT+TAB = 0x020009
3538 - // CTRL-ALT-DEL = 0x0A0053
3539 - // WIN-LEFT = 0x100025
3540 - // WIN-RIGHT = 0x100027
3541 - // SHIFT+F10 = 0x010079
3542 -
3543 - if (desktop.contype == 2) {
3544 - // Intel AMT
3545 - if (flags & 1) { keyArray.push([0xffe1, 1]); keyArray2.push([0xffe1, 0]); } // Shift
3546 - if (flags & 2) { keyArray.push([0xffe9, 1]); keyArray2.push([0xffe9, 0]); } // Left-alt
3547 - if (flags & 8) { keyArray.push([0xffe3, 1]); keyArray2.push([0xffe3, 0]); } // Ctrl
3548 - if (flags & 16) { keyArray.push([0xffe7, 1]); keyArray2.push([0xffe7, 0]); } // Windows key
3549 - if (amtTranslate[key]) { key = amtTranslate[key]; }
3550 - if ((key >= 65) && (key <= 90)) { key += 32; }
3551 - if (key != 0) { keyArray.push([key, 1]); keyArray2.push([key, 0]); }
3552 - keyArray2.reverse();
3553 - for (var i = 0; i < keyArray2.length; i++) { keyArray.push(keyArray2[i]); }
3554 - desktop.m.sendkey(keyArray);
3555 - } else {
3556 - // Agent desktop
3557 - if (flags & 1) { keyArray.push([desktop.m.KeyAction.DOWN, 16]); keyArray2.push([desktop.m.KeyAction.UP, 16]); } // Shift
3558 - if (flags & 2) { keyArray.push([desktop.m.KeyAction.EXDOWN, 18]); keyArray2.push([desktop.m.KeyAction.EXUP, 18]); } // Left-alt
3559 - if (flags & 8) { keyArray.push([desktop.m.KeyAction.EXDOWN, 17]); keyArray2.push([desktop.m.KeyAction.EXUP, 17]); } // Ctrl
3560 - if (flags & 16) { keyArray.push([desktop.m.KeyAction.EXDOWN, 0x5B]); keyArray2.push([desktop.m.KeyAction.EXUP, 0x5B]); } // Windows key
3561 - if (key != 0) { keyArray.push([desktop.m.KeyAction.DOWN, key]); keyArray2.push([desktop.m.KeyAction.UP, key]); }
3562 - keyArray2.reverse();
3563 - for (var i = 0; i < keyArray2.length; i++) { keyArray.push(keyArray2[i]); }
3564 - desktop.m.SendKeyMsgKC(keyArray);
3565 - }
3566 - }
3567 -
3658 function sendSpecialKeys() {
3659 if (xxdialogMode || desktop == null || desktop.State != 3) return;
3660 setDialogMode(3, "Special Keys", 3, deskSendKeys);
views/default.handlebars
+7 -19
@@ -7431,6 +7431,10 @@
7431 }
7432 }
7433
7434 + //
7435 + // Desktop Shortcut Keys
7436 + //
7437 +
7438 function updateDeskShortcutKeys() {
7439 var x = '', v = parseInt(Q('deskkeys').value);
7440 if ((v == '') && (deskKeyboardShortcuts.length > 0)) { v = deskKeyboardShortcuts[0]; }
@@ -7439,22 +7443,7 @@
7443 QH('deskkeys', x);
7444 }
7445
7442 - var keyStrings = {
7443 - 8 : "BackSpace",
7444 - 9 : "Tab",
7445 - 13 : "Enter",
7446 - 27 : "Escape",
7447 - 45 : "Insert",
7448 - 46 : "Del",
7449 - 36 : "Home",
7450 - 35 : "End",
7451 - 33 : "Page Up",
7452 - 34 : "Page Down",
7453 - 37 : "Left",
7454 - 38 : "Up",
7455 - 39 : "Right",
7456 - 40 : "Down"
7457 - }
7446 + var keyStrings = { 8 : "BackSpace", 9 : "Tab", 13 : "Enter", 27 : "Escape", 45 : "Insert", 46 : "Del", 36 : "Home", 35 : "End", 33 : "Page Up", 34 : "Page Down", 37 : "Left", 38 : "Up", 39 : "Right", 40 : "Down", 0 : "None" }
7447
7448 function keyShortcutTotext(n) {
7449 var x = [];
@@ -7464,7 +7453,7 @@
7453 if (n & 0x100000) { x.push("Win"); }
7454 n = (n & 0xFFFF);
7455 if ((n >= 112) && (n <= 123)) { x.push('F' + (n - 111)); } // Fx keys
7467 - else if (keyStrings[n]) { x.push(keyStrings[n]); }
7456 + else if ((n != 0) && (keyStrings[n])) { x.push(keyStrings[n]); }
7457 else { if (n != 0) { x.push(String.fromCharCode(n)); } }
7458 return x.join(' + ');
7459 }
@@ -7528,7 +7517,7 @@
7517 if (Q('d1kalt').checked) { k |= 0x020000; }
7518 if (Q('d1kctrl').checked) { k |= 0x080000; }
7519 if (Q('d1kwin').checked) { k |= 0x100000; }
7531 - if (deskKeyboardShortcuts.indexOf(k) == -1) { deskKeyboardShortcuts.push(k); deskUpdateShortcutList(); }
7520 + if ((k > 0) && (deskKeyboardShortcuts.indexOf(k) == -1)) { deskKeyboardShortcuts.push(k); deskUpdateShortcutList(); }
7521 }
7522
7523 // Remote desktop special key combos for Windows
@@ -7538,7 +7527,6 @@
7527
7528 // Construct the key command
7529 var ks = parseInt(Q('deskkeys').value);
7541 - if (ks == -1) { deskCustomizeKeys(); return; }
7530 if (ks == 0x0A002E) { desktop.m.sendcad(); return; } // CTRL-ALT-DEL
7531 if ((desktop.contype == 1) && (ks == 0x100052)) { desktop.sendCtrlMsg('{"action":"lock"}'); return; } // Lock desktop
7532