From ac1407392180d36f766eff45605edc29df4ccd9a Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Thu, 23 Apr 2026 19:32:11 +0200 Subject: [PATCH] Feature: Support switching remote desktop input language --- server/2015Remote/WebPage.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/server/2015Remote/WebPage.h b/server/2015Remote/WebPage.h index c655be3..ded4f56 100644 --- a/server/2015Remote/WebPage.h +++ b/server/2015Remote/WebPage.h @@ -336,6 +336,9 @@ inline std::string GetWebPageHTML() { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; opacity: 0.8; } + .device-card .active-window.busy { + color: #e94560; opacity: 1; font-weight: 500; + } .device-card .meta-row { display: flex; gap: 12px; margin-top: 6px; font-size: 12px; color: #666; } .device-card .meta-item { display: flex; align-items: center; gap: 4px; } .device-card .meta-item.rtt { font-weight: 500; } @@ -854,6 +857,7 @@ inline std::string GetWebPageHTML() { +
@@ -1221,6 +1225,13 @@ inline std::string GetWebPageHTML() { return 'rtt-poor'; // Red: > 300ms } + function isWindowBusy(activeWindow) { + if (!activeWindow || activeWindow.trim() === '') return false; + const lower = activeWindow.toLowerCase(); + if (lower.includes('locked') || lower.includes('inactive')) return false; + return true; + } + function updateDeviceInfo(deviceId, rtt, activeWindow) { // Update device in array const device = devices.find(d => d.id === deviceId || d.id === String(deviceId)); @@ -1258,6 +1269,7 @@ inline std::string GetWebPageHTML() { } winEl.textContent = activeWindow; winEl.title = activeWindow; + winEl.className = 'active-window' + (isWindowBusy(activeWindow) ? ' busy' : ''); } else if (winEl) { winEl.remove(); } @@ -1303,7 +1315,7 @@ inline std::string GetWebPageHTML() { 'Ver: ' + escapeHtml(ver) + '' + '' + screenInfo + '' + '' + - (activeWin ? '
' + escapeHtml(activeWin) + '
' : '') + + (activeWin ? '
' + escapeHtml(activeWin) + '
' : '') + ''; }).join(''); } @@ -2584,10 +2596,13 @@ inline std::string GetWebPageHTML() { e.preventDefault(); const keyCode = parseInt(btn.dataset.key); const needShift = btn.dataset.shift === '1'; + const needCtrl = btn.dataset.ctrl === '1'; + if (needCtrl) sendShortcutKey(17, true); // Ctrl down if (needShift) sendShortcutKey(16, true); // Shift down sendShortcutKey(keyCode, true); sendShortcutKey(keyCode, false); if (needShift) sendShortcutKey(16, false); // Shift up + if (needCtrl) sendShortcutKey(17, false); // Ctrl up }); btn.addEventListener('click', function(e) { e.preventDefault(); @@ -2595,10 +2610,13 @@ inline std::string GetWebPageHTML() { if (!('ontouchstart' in window)) { const keyCode = parseInt(btn.dataset.key); const needShift = btn.dataset.shift === '1'; + const needCtrl = btn.dataset.ctrl === '1'; + if (needCtrl) sendShortcutKey(17, true); // Ctrl down if (needShift) sendShortcutKey(16, true); sendShortcutKey(keyCode, true); sendShortcutKey(keyCode, false); if (needShift) sendShortcutKey(16, false); + if (needCtrl) sendShortcutKey(17, false); // Ctrl up } }); });