|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <list> |
|
|
#include <list> |
|
|
|
|
|
|
|
|
#include <rfb/VNCServerST.h> |
|
|
|
|
|
|
|
|
#include <rdr/types.h> |
|
|
|
|
|
#include <rfb/Rect.h> |
|
|
|
|
|
|
|
|
extern "C" { |
|
|
extern "C" { |
|
|
#include "input.h" |
|
|
#include "input.h" |
|
|
|
|
|
/* The Xorg headers define macros that wreak havoc with STL */ |
|
|
|
|
|
#undef max |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
#include "xorg-version.h" |
|
|
#include "xorg-version.h" |
|
|
|
|
|
|
|
|
class InputDevice { |
|
|
class InputDevice { |
|
|
public: |
|
|
public: |
|
|
/* Create new InputDevice instance */ |
|
|
/* Create new InputDevice instance */ |
|
|
InputDevice(rfb::VNCServerST *_server); |
|
|
|
|
|
|
|
|
InputDevice(); |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
* Press or release buttons. Relationship between buttonMask and |
|
|
* Press or release buttons. Relationship between buttonMask and |
|
|
|
|
|
|
|
|
/* Move pointer to target location (point coords are absolute). */ |
|
|
/* Move pointer to target location (point coords are absolute). */ |
|
|
void PointerMove(const rfb::Point &point); |
|
|
void PointerMove(const rfb::Point &point); |
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
* Send pointer position to clients. If not called then Move() calls |
|
|
|
|
|
* won't be visible to VNC clients. |
|
|
|
|
|
*/ |
|
|
|
|
|
void PointerSync(void); |
|
|
|
|
|
|
|
|
/* Get current known location of the pointer */ |
|
|
|
|
|
const rfb::Point &getPointerPos(void); |
|
|
|
|
|
|
|
|
|
|
|
/* Press or release one or more keys to get the given symbol */ |
|
|
void KeyboardPress(rdr::U32 keysym) { keyEvent(keysym, true); } |
|
|
void KeyboardPress(rdr::U32 keysym) { keyEvent(keysym, true); } |
|
|
void KeyboardRelease(rdr::U32 keysym) { keyEvent(keysym, false); } |
|
|
void KeyboardRelease(rdr::U32 keysym) { keyEvent(keysym, false); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
rfb::VNCServerST *server; |
|
|
|
|
|
bool initialized; |
|
|
bool initialized; |
|
|
DeviceIntPtr keyboardDev; |
|
|
DeviceIntPtr keyboardDev; |
|
|
DeviceIntPtr pointerDev; |
|
|
DeviceIntPtr pointerDev; |
|
|
|
|
|
|
|
|
int oldButtonMask; |
|
|
int oldButtonMask; |
|
|
rfb::Point cursorPos, oldCursorPos; |
|
|
|
|
|
|
|
|
rfb::Point cursorPos; |
|
|
|
|
|
|
|
|
KeySym pressedKeys[256]; |
|
|
KeySym pressedKeys[256]; |
|
|
}; |
|
|
}; |