-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for forward and back mouse buttons #1919
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4931,7 +4931,14 @@ describe('RFB messages', function () { | |
it('should send correct data for pointer events', function () { | ||
RFB.messages.pointerEvent(sock, 12345, 54321, 0xab); | ||
let expected = | ||
[ 5, 0xab, 0x30, 0x39, 0xd4, 0x31]; | ||
[ 5, 0x2b, 0x30, 0x39, 0xd4, 0x31]; | ||
expect(sock).to.have.sent(new Uint8Array(expected)); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The masking should probably be tested as an explicitly different test. |
||
|
||
it('should send correct data for extended pointer events', function () { | ||
RFB.messages.extendedPointerEvent(sock, 12345, 54321, 0xab); | ||
let expected = | ||
[ 5, 0xab, 0x30, 0x39, 0xd4, 0x31, 0x01]; | ||
expect(sock).to.have.sent(new Uint8Array(expected)); | ||
}); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'd also like tests for the interaction with the pseudo-encoding and pseudo-rect. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking, Safari has buggy support rather than no support. Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
I just realized that safari send the incorrect
ev.button
value, but the button maskev.buttons
seems to work correctly. With back pressed,ev.buttons
is 8, and with forward pressed, it is 16.We could look at those instead of keeping mouse button state ourselves?