}
-void CMsgWriter::writePointerEvent(const Point& pos, int buttonMask)
+void CMsgWriter::writePointerEvent(const Point& pos, uint8_t buttonMask)
{
Point p(pos);
if (p.x < 0) p.x = 0;
void writeFence(uint32_t flags, unsigned len, const uint8_t data[]);
void writeKeyEvent(uint32_t keysym, uint32_t keycode, bool down);
- void writePointerEvent(const Point& pos, int buttonMask);
+ void writePointerEvent(const Point& pos, uint8_t buttonMask);
void writeClientCutText(const char* str);
// pointerEvent() is called whenever a client sends an event that
// the pointer moved, or a button was pressed or released.
virtual void pointerEvent(const Point& /*pos*/,
- int /*buttonMask*/) {};
+ uint8_t /*buttonMask*/) {};
// handleClipboardRequest() is called whenever a client requests
// the server to send over its clipboard data. It will only be
}
void SMsgHandler::pointerEvent(const Point& /*pos*/,
- int /*buttonMask*/)
+ uint8_t /*buttonMask*/)
{
}
virtual void keyEvent(uint32_t keysym, uint32_t keycode,
bool down);
virtual void pointerEvent(const Point& pos,
- int buttonMask);
+ uint8_t buttonMask);
virtual void clientCutText(const char* str);
setCursor();
}
-void VNCSConnectionST::pointerEvent(const Point& pos, int buttonMask)
+void VNCSConnectionST::pointerEvent(const Point& pos, uint8_t buttonMask)
{
if (rfb::Server::idleTimeout)
idleTimer.start(secsToMillis(rfb::Server::idleTimeout));
void queryConnection(const char* userName) override;
void clientInit(bool shared) override;
void setPixelFormat(const PixelFormat& pf) override;
- void pointerEvent(const Point& pos, int buttonMask) override;
+ void pointerEvent(const Point& pos, uint8_t buttonMask) override;
void keyEvent(uint32_t keysym, uint32_t keycode,
bool down) override;
void framebufferUpdateRequest(const Rect& r,
}
void VNCServerST::pointerEvent(VNCSConnectionST* client,
- const Point& pos, int buttonMask)
+ const Point& pos, uint8_t buttonMask)
{
time_t now = time(nullptr);
if (rfb::Server::maxIdleTime)
// Event handlers
void keyEvent(uint32_t keysym, uint32_t keycode, bool down);
- void pointerEvent(VNCSConnectionST* client, const Point& pos, int buttonMask);
+ void pointerEvent(VNCSConnectionST* client, const Point& pos, uint8_t buttonMask);
void handleClipboardRequest(VNCSConnectionST* client);
void handleClipboardAnnounce(VNCSConnectionST* client, bool available);
class TestClass : public EmulateMB
{
public:
- void sendPointerEvent(const rfb::Point& pos, int buttonMask) override;
+ void sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask) override;
- struct PointerEventParams {rfb::Point pos; int mask; };
+ struct PointerEventParams {rfb::Point pos; uint8_t mask; };
std::vector<PointerEventParams> results;
};
-void TestClass::sendPointerEvent(const rfb::Point& pos, int buttonMask)
+void TestClass::sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask)
{
PointerEventParams params;
params.pos = pos;
queryConnectDialog->map();
}
-void XDesktop::pointerEvent(const Point& pos, int buttonMask) {
+void XDesktop::pointerEvent(const Point& pos, uint8_t buttonMask) {
#ifdef HAVE_XTEST
if (!haveXtest) return;
XTestFakeMotionEvent(dpy, DefaultScreen(dpy),
bool isRunning();
void queryConnection(network::Socket* sock,
const char* userName) override;
- void pointerEvent(const rfb::Point& pos, int buttonMask) override;
+ void pointerEvent(const rfb::Point& pos, uint8_t buttonMask) override;
void keyEvent(uint32_t keysym, uint32_t xtcode, bool down) override;
unsigned int setScreenLayout(int fb_width, int fb_height,
const rfb::ScreenSet& layout) override;
rfb::VNCServer* server;
QueryConnectDialog* queryConnectDialog;
network::Socket* queryConnectSock;
- int oldButtonMask;
+ uint8_t oldButtonMask;
bool haveXtest;
bool haveDamage;
int maxButtons;
kill(getpid(), SIGTERM);
}
-void XserverDesktop::pointerEvent(const Point& pos, int buttonMask)
+void XserverDesktop::pointerEvent(const Point& pos, uint8_t buttonMask)
{
vncPointerMove(pos.x + vncGetScreenX(screenIndex),
pos.y + vncGetScreenY(screenIndex));
void terminate() override;
void queryConnection(network::Socket* sock,
const char* userName) override;
- void pointerEvent(const rfb::Point& pos, int buttonMask) override;
+ void pointerEvent(const rfb::Point& pos, uint8_t buttonMask) override;
void keyEvent(uint32_t keysym, uint32_t keycode, bool down) override;
unsigned int setScreenLayout(int fb_width, int fb_height,
const rfb::ScreenSet& layout) override;
{
}
-void EmulateMB::filterPointerEvent(const rfb::Point& pos, int buttonMask)
+void EmulateMB::filterPointerEvent(const rfb::Point& pos, uint8_t buttonMask)
{
int btstate;
int action1, action2;
void EmulateMB::handleTimeout(rfb::Timer *t)
{
int action1, action2;
- int buttonMask;
+ uint8_t buttonMask;
if (&timer != t)
return;
state = stateTab[state][4][2];
}
-void EmulateMB::sendAction(const rfb::Point& pos, int buttonMask, int action)
+void EmulateMB::sendAction(const rfb::Point& pos, uint8_t buttonMask, int action)
{
assert(action != 0);
sendPointerEvent(pos, buttonMask);
}
-int EmulateMB::createButtonMask(int buttonMask)
+int EmulateMB::createButtonMask(uint8_t buttonMask)
{
// Unset left and right buttons in the mask
buttonMask &= ~0x5;
public:
EmulateMB();
- void filterPointerEvent(const rfb::Point& pos, int buttonMask);
+ void filterPointerEvent(const rfb::Point& pos, uint8_t buttonMask);
protected:
- virtual void sendPointerEvent(const rfb::Point& pos, int buttonMask)=0;
+ virtual void sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask)=0;
void handleTimeout(rfb::Timer *t) override;
private:
- void sendAction(const rfb::Point& pos, int buttonMask, int action);
+ void sendAction(const rfb::Point& pos, uint8_t buttonMask, int action);
- int createButtonMask(int buttonMask);
+ int createButtonMask(uint8_t buttonMask);
private:
int state;
- int emulatedButtonMask;
- int lastButtonMask;
+ uint8_t emulatedButtonMask;
+ uint8_t lastButtonMask;
rfb::Point lastPos, origPos;
rfb::Timer timer;
};
return Fl_Widget::handle(event);
}
-void Viewport::sendPointerEvent(const rfb::Point& pos, int buttonMask)
+void Viewport::sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask)
{
if (viewOnly)
return;
}
-void Viewport::handlePointerEvent(const rfb::Point& pos, int buttonMask)
+void Viewport::handlePointerEvent(const rfb::Point& pos, uint8_t buttonMask)
{
filterPointerEvent(pos, buttonMask);
}
int handle(int event) override;
protected:
- void sendPointerEvent(const rfb::Point& pos, int buttonMask) override;
+ void sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask) override;
private:
bool hasFocus();
void flushPendingClipboard();
- void handlePointerEvent(const rfb::Point& pos, int buttonMask);
+ void handlePointerEvent(const rfb::Point& pos, uint8_t buttonMask);
static void handlePointerTimeout(void *data);
void resetKeyboard();
PlatformPixelBuffer* frameBuffer;
rfb::Point lastPointerPos;
- int lastButtonMask;
+ uint8_t lastButtonMask;
typedef std::map<int, uint32_t> DownMap;
DownMap downKeySym;
}
-void SDisplay::pointerEvent(const Point& pos, int buttonmask) {
+void SDisplay::pointerEvent(const Point& pos, uint8_t buttonmask) {
if (pb->getRect().contains(pos)) {
Point screenPos = pos.translate(screenRect.tl);
// - Check that the SDesktop doesn't need restarting
void handleClipboardRequest() override;
void handleClipboardAnnounce(bool available) override;
void handleClipboardData(const char* data) override;
- void pointerEvent(const Point& pos, int buttonmask) override;
+ void pointerEvent(const Point& pos, uint8_t buttonmask) override;
void keyEvent(uint32_t keysym, uint32_t keycode, bool down) override;
// -=- Clipboard events
}
void
-win32::SPointer::pointerEvent(const Point& pos, int buttonmask)
+win32::SPointer::pointerEvent(const Point& pos, uint8_t buttonmask)
{
// - We are specifying absolute coordinates
DWORD flags = MOUSEEVENTF_ABSOLUTE;
// - Create a pointer event at a the given coordinates, with the
// specified button state. The event must be specified using
// Screen coordinates.
- void pointerEvent(const Point& pos, int buttonmask);
+ void pointerEvent(const Point& pos, uint8_t buttonmask);
protected:
Point last_position;
uint8_t last_buttonmask;