Hide mouse object from RFB callers

This commit is contained in:
Pierre Ossman 2017-10-13 13:07:17 +02:00
parent b9854a5ca5
commit f976b5500e
3 changed files with 11 additions and 2 deletions

View File

@ -1657,7 +1657,7 @@ var UI = {
setMouseButton: function(num) { setMouseButton: function(num) {
var view_only = UI.rfb.get_view_only(); var view_only = UI.rfb.get_view_only();
if (UI.rfb && !view_only) { if (UI.rfb && !view_only) {
UI.rfb.get_mouse().set_touchButton(num); UI.rfb.set_touchButton(num);
} }
var blist = [0, 1,2,4]; var blist = [0, 1,2,4];

View File

@ -1493,6 +1493,7 @@ make_properties(RFB, [
['local_cursor', 'rw', 'bool'], // Request locally rendered cursor ['local_cursor', 'rw', 'bool'], // Request locally rendered cursor
['shared', 'rw', 'bool'], // Request shared mode ['shared', 'rw', 'bool'], // Request shared mode
['view_only', 'rw', 'bool'], // Disable client mouse/keyboard ['view_only', 'rw', 'bool'], // Disable client mouse/keyboard
['touchButton', 'rw', 'int'], // Button mask (1, 2, 4) for touch devices (0 means ignore clicks)
['scale', 'rw', 'float'], // Display area scale factor ['scale', 'rw', 'float'], // Display area scale factor
['viewport', 'rw', 'bool'], // Use viewport clipping ['viewport', 'rw', 'bool'], // Use viewport clipping
['xvp_password_sep', 'rw', 'str'], // Separator for XVP password fields ['xvp_password_sep', 'rw', 'str'], // Separator for XVP password fields
@ -1549,6 +1550,14 @@ RFB.prototype.set_view_only = function (view_only) {
} }
}; };
RFB.prototype.set_touchButton = function (button) {
this._mouse.set_touchButton(button);
};
RFB.prototype.get_touchButton = function () {
return this._mouse.get_touchButton();
};
RFB.prototype.set_scale = function (scale) { RFB.prototype.set_scale = function (scale) {
this._display.set_scale(scale); this._display.set_scale(scale);
}; };
@ -1566,7 +1575,6 @@ RFB.prototype.get_viewport = function () {
}; };
RFB.prototype.get_keyboard = function () { return this._keyboard; }; RFB.prototype.get_keyboard = function () { return this._keyboard; };
RFB.prototype.get_mouse = function () { return this._mouse; };
// Class Methods // Class Methods
RFB.messages = { RFB.messages = {

View File

@ -34,6 +34,7 @@ attribute mode is one of the following:
| local_cursor | bool | RW | false | Request locally rendered cursor | local_cursor | bool | RW | false | Request locally rendered cursor
| shared | bool | RW | true | Request shared VNC mode | shared | bool | RW | true | Request shared VNC mode
| view_only | bool | RW | false | Disable client mouse/keyboard | view_only | bool | RW | false | Disable client mouse/keyboard
| touchButton | int | RW | 1 | Button mask (1, 2, 4) for which click to send on touch devices. 0 means ignore clicks.
| scale | float | RW | 1.0 | Display area scale factor | scale | float | RW | 1.0 | Display area scale factor
| viewport | bool | RW | false | Use viewport clipping | viewport | bool | RW | false | Use viewport clipping
| xvp_password_sep | str | RW | '@' | Separator for XVP password fields | xvp_password_sep | str | RW | '@' | Separator for XVP password fields