Commit d02a99f0 authored by Solly Ross's avatar Solly Ross

Fixed Typo Causing MouseUp to not Register

There was a typo in one of the instances of the _buttonMask field
(it was written as _buttonMaks), causing MouseUp to never be sent.
This has been rectified, and the unit tests for the mouse handler
have been changed to check for explicitly sending mouseup and
mousedown.

Fixes #393
parent f0e4548b
...@@ -550,7 +550,7 @@ var RFB; ...@@ -550,7 +550,7 @@ var RFB;
if (down) { if (down) {
this._mouse_buttonMask |= bmask; this._mouse_buttonMask |= bmask;
} else { } else {
this._mouse_buttonMaks ^= bmask; this._mouse_buttonMask ^= bmask;
} }
if (this._viewportDrag) { if (this._viewportDrag) {
......
...@@ -1512,6 +1512,20 @@ describe('Remote Frame Buffer Protocol Client', function() { ...@@ -1512,6 +1512,20 @@ describe('Remote Frame Buffer Protocol Client', function() {
expect(client._sock.send).to.have.been.calledWith(pointer_msg); expect(client._sock.send).to.have.been.calledWith(pointer_msg);
}); });
it('should send a mask of 1 on mousedown', function () {
client._mouse._onMouseButton(10, 12, 1, 0x001);
expect(client._sock.send).to.have.been.calledOnce;
var pointer_msg = RFB.messages.pointerEvent(10, 12, 0x001);
expect(client._sock.send).to.have.been.calledWith(pointer_msg);
});
it('should send a mask of 0 on mouseup', function () {
client._mouse._onMouseButton(10, 12, 0, 0x001);
expect(client._sock.send).to.have.been.calledOnce;
var pointer_msg = RFB.messages.pointerEvent(10, 12, 0x000);
expect(client._sock.send).to.have.been.calledWith(pointer_msg);
});
it('should send a pointer event on mouse movement', function () { it('should send a pointer event on mouse movement', function () {
client._mouse._onMouseMove(10, 12); client._mouse._onMouseMove(10, 12);
expect(client._sock.send).to.have.been.calledOnce; expect(client._sock.send).to.have.been.calledOnce;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment