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,6 +184,7 @@ var RFB;
throw exc;
}
if (!this._view_only) {
this._keyboard = new Keyboard({target: this._focusContainer,
onKeyPress: this._handleKeyPress.bind(this)});
@ -191,6 +192,7 @@ var RFB;
onMouseButton: this._handleMouseButton.bind(this),
onMouseMove: this._handleMouseMove.bind(this),
notify: this._keyboard.sync.bind(this._keyboard)});
}
this._sock = new Websock();
this._sock.on('message', this._handle_message.bind(this));