vnc: Add uinput support
diff --git a/src/VNCFlinger.cpp b/src/VNCFlinger.cpp
index 0ca2784..dfb1a38 100644
--- a/src/VNCFlinger.cpp
+++ b/src/VNCFlinger.cpp
@@ -9,6 +9,7 @@
 #include <gui/SurfaceComposerClient.h>
 #include <gui/IGraphicBufferProducer.h>
 
+#include "InputDevice.h"
 #include "VNCFlinger.h"
 
 using namespace android;
@@ -74,6 +75,8 @@
     mVNCScreen->httpDir = NULL;
     mVNCScreen->port = VNC_PORT;
     mVNCScreen->newClientHook = (rfbNewClientHookPtr) VNCFlinger::onNewClient;
+    mVNCScreen->kbdAddEvent = InputDevice::keyEvent;
+    mVNCScreen->ptrAddEvent = InputDevice::pointerEvent;
     mVNCScreen->serverFormat.trueColour = true;
     mVNCScreen->serverFormat.bitsPerPixel = 32;
     mVNCScreen->handleEventsEagerly = true;
@@ -111,6 +114,7 @@
     switch(event.mId) {
         case EVENT_CLIENT_CONNECT:
             if (mClientCount == 0) {
+                InputDevice::start(mWidth, mHeight);
                 mVirtualDisplay->start(mMainDpyInfo, sQueue);
             }
             mClientCount++;
@@ -123,6 +127,7 @@
                 mClientCount--;
                 if (mClientCount == 0) {
                     mVirtualDisplay->stop();
+                    InputDevice::stop();
                 }
             }