mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2026-07-17 16:36:49 +00:00
VNC-14 Update to relative mouse for better UX and app compatibility
This commit is contained in:
parent
dd1417229e
commit
9050929aa9
22 changed files with 121 additions and 4 deletions
|
|
@ -108,6 +108,9 @@ void SMsgReader::readMsg()
|
|||
case msgTypeKeepAlive:
|
||||
readKeepAlive();
|
||||
break;
|
||||
case msgTypeDirectMouseEvent:
|
||||
readDirectMouseEvent();
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "unknown message type %d\n", msgType);
|
||||
throw Exception("unknown message type");
|
||||
|
|
@ -422,3 +425,20 @@ void SMsgReader::readVideoEncodersRequest() const {
|
|||
|
||||
handler->videoEncodersRequest(buf);
|
||||
}
|
||||
|
||||
void SMsgReader::readDirectMouseEvent()
|
||||
{
|
||||
// Wire format (9 bytes after the type byte):
|
||||
// byte 0: button mask (bit 0=left, 1=right, 2=middle, 3=side, 4=extra)
|
||||
// bytes 1-2: dx (int16 BE)
|
||||
// bytes 3-4: dy (int16 BE)
|
||||
// bytes 5-6: scroll dx (int16 BE)
|
||||
// bytes 7-8: scroll dy (int16 BE)
|
||||
int buttonMask = is->readU8();
|
||||
int dx = is->readS16();
|
||||
int dy = is->readS16();
|
||||
int scrollX = is->readS16();
|
||||
int scrollY = is->readS16();
|
||||
|
||||
handler->directMouseEvent(dx, dy, buttonMask, scrollX, scrollY);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue