View-only mode doesn't need keyboard or mouse

Grabbing the keyboard and mouse is unnecessary in view_only mode.
In fact its unnecessary to create the objects at all. Fixes #644.
This commit is contained in:
Samuel Mannehed 2016-08-30 09:27:32 +02:00
parent f4f4e8993d
commit 0ccf432f12
1 changed files with 8 additions and 6 deletions

View File

@ -184,13 +184,15 @@ var RFB;
throw exc; throw exc;
} }
this._keyboard = new Keyboard({target: this._focusContainer, if (!this._view_only) {
onKeyPress: this._handleKeyPress.bind(this)}); this._keyboard = new Keyboard({target: this._focusContainer,
onKeyPress: this._handleKeyPress.bind(this)});
this._mouse = new Mouse({target: this._target, this._mouse = new Mouse({target: this._target,
onMouseButton: this._handleMouseButton.bind(this), onMouseButton: this._handleMouseButton.bind(this),
onMouseMove: this._handleMouseMove.bind(this), onMouseMove: this._handleMouseMove.bind(this),
notify: this._keyboard.sync.bind(this._keyboard)}); notify: this._keyboard.sync.bind(this._keyboard)});
}
this._sock = new Websock(); this._sock = new Websock();
this._sock.on('message', this._handle_message.bind(this)); this._sock.on('message', this._handle_message.bind(this));