Added 'view_only' config option to vnc_auto.htm and plumbing.

This commit is contained in:
Matthew Balman 2011-10-19 16:11:27 -05:00
parent a538be4350
commit f3861500e4
3 changed files with 12 additions and 3 deletions

View File

@ -131,6 +131,7 @@ Util.conf_defaults(conf, that, defaults, [
['true_color', 'rw', 'bool', true, 'Request true color pixel data'],
['local_cursor', 'rw', 'bool', false, 'Request locally rendered cursor'],
['shared', 'rw', 'bool', true, 'Request shared mode'],
['view_only', 'rw', 'bool', false, 'Disable client mouse/keyboard'],
['connectTimeout', 'rw', 'int', def_con_timeout, 'Time (s) to wait for connection'],
['disconnectTimeout', 'rw', 'int', 3, 'Time (s) to wait for disconnection'],
@ -207,11 +208,17 @@ function constructor() {
Util.Error("Display exception: " + exc);
updateState('fatal', "No working Display");
}
keyboard = new Keyboard({'target': conf.focusContainer,
if(!conf.view_only) {
keyboard = new Keyboard({'target': conf.focusContainer,
'onKeyPress': keyPress});
mouse = new Mouse({'target': conf.target,
mouse = new Mouse({'target': conf.target,
'onMouseButton': mouseButton,
'onMouseMove': mouseMove});
}
else {
keyboard = new Keyboard({'target': conf.focusContainer});
mouse = new Mouse({'target': conf.target});
}
rmode = display.get_render_mode();
@ -1556,7 +1563,7 @@ that.sendPassword = function(passwd) {
};
that.sendCtrlAltDel = function() {
if (rfb_state !== "normal") { return false; }
if (rfb_state !== "normal" || conf.view_only==true) { return false; }
Util.Info("Sending Ctrl-Alt-Del");
var arr = [];
arr = arr.concat(keyEvent(0xFFE3, 1)); // Control

View File

@ -52,6 +52,7 @@ load: function() {
UI.initSetting('true_color', true);
UI.initSetting('cursor', false);
UI.initSetting('shared', true);
UI.initSetting('view_only',false);
UI.initSetting('connectTimeout', 2);
UI.initSetting('path', '');

View File

@ -105,6 +105,7 @@
'true_color': WebUtil.getQueryVar('true_color', true),
'local_cursor': WebUtil.getQueryVar('cursor', true),
'shared': WebUtil.getQueryVar('shared', true),
'view_only': WebUtil.getQueryVar('view_only',false),
'updateState': updateState,
'onPasswordRequired': passwordRequired});
rfb.connect(host, port, password, path);