vncBell();
}
+static void vncKeyboardCtrl(DeviceIntPtr pDevice, KeybdCtrl *ctrl)
+{
+ vncSetLEDState(ctrl->leds);
+}
+
static int vncKeyboardProc(DeviceIntPtr pDevice, int onoff)
{
DevicePtr pDev = (DevicePtr)pDevice;
switch (onoff) {
case DEVICE_INIT:
InitKeyboardDeviceStruct(pDevice, NULL, vncKeyboardBell,
- (KbdCtrlProcPtr)NoopDDA);
+ vncKeyboardCtrl);
break;
case DEVICE_ON:
pDev->on = TRUE;
server->bell();
}
+void XserverDesktop::setLEDState(unsigned int state)
+{
+ server->setLEDState(state);
+}
+
void XserverDesktop::serverCutText(const char* str, int len)
{
try {
void setFramebuffer(int w, int h, void* fbptr, int stride);
void refreshScreenLayout();
void bell();
+ void setLEDState(unsigned int state);
void serverCutText(const char* str, int len);
void setDesktopName(const char* name);
void setCursor(int width, int height, int hotX, int hotY,
#include <rfb/LogWriter.h>
#include <rfb/Hostname.h>
#include <rfb/Region.h>
+#include <rfb/ledStates.h>
#include <network/TcpSocket.h>
#include "XserverDesktop.h"
}
}
+void vncSetLEDState(unsigned long leds)
+{
+ unsigned int state;
+
+ state = 0;
+ if (leds & (1 << 0))
+ state |= ledCapsLock;
+ if (leds & (1 << 1))
+ state |= ledNumLock;
+ if (leds & (1 << 2))
+ state |= ledScrollLock;
+
+ for (int scr = 0; scr < vncGetScreenCount(); scr++) {
+ if (desktop[scr] == NULL)
+ continue;
+ desktop[scr]->setLEDState(state);
+ }
+}
+
void vncAddChanged(int scrIdx, const struct UpdateRect *extents,
int nRects, const struct UpdateRect *rects)
{
void vncBell(void);
+void vncSetLEDState(unsigned long leds);
+
// Must match rfb::ShortRect in common/rfb/Region.h, and BoxRec in the
// Xorg source.
struct UpdateRect {