We have a novnc server running and access the console of vms on other servers via the novnc server.
I also added a method in novnc to send a string via keyevent. The code looks like
+ sendString : function(str) {
+ if (this._rfb_state !== "normal" || this._view_only) { return false; }
+ Util.Info("Sending: "+str);
+ var arr = [];
+ for (var i = 0; i < str.length; i++ ) {
+ var char = str.substring(i, i + 1);
+ var code = char.charCodeAt(0);
+ if (shifted[char]) RFB.messages.keyEvent(this._sock, XK_Shift_L, 1); // Shift
+ RFB.messages.keyEvent(this._sock, code, 1); // (key)
+ RFB.messages.keyEvent(this._sock, code, 0); // (key)
+ if (shifted[char]) RFB.messages.keyEvent(this._sock, XK_Shift_L, 0); // Shift
+ }
+
+ this._sock.flush();
+ },
+
In my testing, only 8 chars can be accepted via novnc even the string is much longer.
As described in [1], the patch fixes the issue. I verified it is working.
Hi Christian,
Thanks for your effort on this issue.
We have a novnc server running and access the console of vms on other servers via the novnc server.
I also added a method in novnc to send a string via keyevent. The code looks like
+ sendString : function(str) { keyEvent( this._sock, XK_Shift_L, 1); // Shift keyEvent( this._sock, code, 1); // (key) keyEvent( this._sock, code, 0); // (key) keyEvent( this._sock, XK_Shift_L, 0); // Shift
+ if (this._rfb_state !== "normal" || this._view_only) { return false; }
+ Util.Info("Sending: "+str);
+ var arr = [];
+ for (var i = 0; i < str.length; i++ ) {
+ var char = str.substring(i, i + 1);
+ var code = char.charCodeAt(0);
+ if (shifted[char]) RFB.messages.
+ RFB.messages.
+ RFB.messages.
+ if (shifted[char]) RFB.messages.
+ }
+
+ this._sock.flush();
+ },
+
In my testing, only 8 chars can be accepted via novnc even the string is much longer.
As described in [1], the patch fixes the issue. I verified it is working.
[1] http:// lists.nongnu. org/archive/ html/qemu- devel/2016- 06/msg00397. html