diff options
author | dscho <dscho> | 2006-03-28 14:49:21 +0000 |
---|---|---|
committer | dscho <dscho> | 2006-03-28 14:49:21 +0000 |
commit | 1602b345f3e7e508b043133d5c289d9984e39f18 (patch) | |
tree | 0698f886cd49a803dcfbbd08ab5b4cd4c7a9fd73 /libvncclient | |
parent | 5920dc18d75a53690ed8690867f501c51595daf1 (diff) | |
download | libtdevnc-1602b345f3e7e508b043133d5c289d9984e39f18.tar.gz libtdevnc-1602b345f3e7e508b043133d5c289d9984e39f18.zip |
add KeyboardLedState extension
Diffstat (limited to 'libvncclient')
-rw-r--r-- | libvncclient/rfbproto.c | 21 | ||||
-rw-r--r-- | libvncclient/vncviewer.c | 7 |
2 files changed, 27 insertions, 1 deletions
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index 7f79c92..fe58a5e 100644 --- a/libvncclient/rfbproto.c +++ b/libvncclient/rfbproto.c @@ -521,6 +521,7 @@ SetFormatAndEncodings(rfbClient* client) rfbEncodingQualityLevel0); } + if (client->appData.useRemoteCursor) { if (se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingXCursor); @@ -530,6 +531,11 @@ SetFormatAndEncodings(rfbClient* client) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingPointerPos); } + /* Let's receive keyboard state encoding if available */ + if (se->nEncodings < MAX_ENCODINGS) { + encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingKeyboardLedState); + } + if (se->nEncodings < MAX_ENCODINGS && requestLastRectEncoding) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingLastRect); } @@ -586,6 +592,11 @@ SetFormatAndEncodings(rfbClient* client) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingPointerPos); } + /* Keyboard State Encodings */ + if (se->nEncodings < MAX_ENCODINGS) { + encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingKeyboardLedState); + } + encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingLastRect); } @@ -785,6 +796,16 @@ HandleRFBServerMessage(rfbClient* client) } continue; } + + if (rect.encoding == rfbEncodingKeyboardLedState) { + /* OK! We have received a keyboard state message!!! */ + client->KeyboardLedStateEnabled = 1; + if (client->HandleKeyboardLedState!=NULL) + client->HandleKeyboardLedState(client, rect.r.x, 0); + // stash it for the future + client->CurrentKeyboardLedState = rect.r.x; + continue; + } if ((rect.r.x + rect.r.w > client->si.framebufferWidth) || (rect.r.y + rect.r.h > client->si.framebufferHeight)) diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c index 8ad5928..635b987 100644 --- a/libvncclient/vncviewer.c +++ b/libvncclient/vncviewer.c @@ -116,7 +116,10 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel, client->programName=""; client->serverHost=""; client->serverPort=5900; - + + client->CurrentKeyboardLedState = 0; + client->HandleKeyboardLedState = DummyPoint; + client->format.bitsPerPixel = bytesPerPixel*8; client->format.depth = bitsPerSample*samplesPerPixel; client->appData.requestedDepth=client->format.depth; @@ -171,6 +174,8 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel, client->GetPassword = ReadPassword; client->MallocFrameBuffer = MallocFrameBuffer; client->Bell = Dummy; + client->CurrentKeyboardLedState = 0; + client->HandleKeyboardLedState = DummyPoint; return client; } |