From 93bb0f95089e74eb4540d48554cb12afb22d68ca Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 7 Nov 2012 12:54:17 +0900 Subject: [PATCH] add "send backslash" button. it's impossible to send a plain backslash keysym without ALT using MacBookPro with JP keyboard. option+yen produces a backslash but, because noVNC maps option key to ALT, it ends up with sending ALT+backslash to the server. --- vnc_auto.html | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/vnc_auto.html b/vnc_auto.html index a6273256..a7e72a79 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -26,6 +26,8 @@ @@ -66,9 +68,10 @@ return false; } function updateState(rfb, state, oldstate, msg) { - var s, sb, cad, level; + var s, sb, bs, cad, level; s = $D('noVNC_status'); sb = $D('noVNC_status_bar'); + bs = $D('sendBackslashButton'); cad = $D('sendCtrlAltDelButton'); switch (state) { case 'failed': level = "error"; break; @@ -79,8 +82,13 @@ default: level = "warn"; break; } - if (state === "normal") { cad.disabled = false; } - else { cad.disabled = true; } + if (state === "normal") { + bs.disabled = false; + cad.disabled = false; + } else { + bs.disabled = true; + cad.disabled = true; + } if (typeof(msg) !== 'undefined') { sb.setAttribute("class", "noVNC_status_" + level); @@ -91,6 +99,11 @@ window.onscriptsload = function () { var host, port, password, path, token; + $D('sendBackslashButton').style.display = "inline"; + $D('sendBackslashButton').onclick = function() { + rfb.sendKey(0x5C); + return false; + } $D('sendCtrlAltDelButton').style.display = "inline"; $D('sendCtrlAltDelButton').onclick = sendCtrlAltDel;
Loading
+