aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/EmulateMB.cxx8
-rw-r--r--vncviewer/EmulateMB.h12
-rw-r--r--vncviewer/Viewport.cxx20
-rw-r--r--vncviewer/Viewport.h6
4 files changed, 31 insertions, 15 deletions
diff --git a/vncviewer/EmulateMB.cxx b/vncviewer/EmulateMB.cxx
index fef8b3d9..ef19ace4 100644
--- a/vncviewer/EmulateMB.cxx
+++ b/vncviewer/EmulateMB.cxx
@@ -199,7 +199,7 @@ EmulateMB::EmulateMB()
{
}
-void EmulateMB::filterPointerEvent(const rfb::Point& pos, uint8_t buttonMask)
+void EmulateMB::filterPointerEvent(const rfb::Point& pos, uint16_t buttonMask)
{
int btstate;
int action1, action2;
@@ -280,7 +280,7 @@ void EmulateMB::filterPointerEvent(const rfb::Point& pos, uint8_t buttonMask)
void EmulateMB::handleTimeout(rfb::Timer *t)
{
int action1, action2;
- uint8_t buttonMask;
+ uint16_t buttonMask;
if (&timer != t)
return;
@@ -312,7 +312,7 @@ void EmulateMB::handleTimeout(rfb::Timer *t)
state = stateTab[state][4][2];
}
-void EmulateMB::sendAction(const rfb::Point& pos, uint8_t buttonMask, int action)
+void EmulateMB::sendAction(const rfb::Point& pos, uint16_t buttonMask, int action)
{
assert(action != 0);
@@ -325,7 +325,7 @@ void EmulateMB::sendAction(const rfb::Point& pos, uint8_t buttonMask, int action
sendPointerEvent(pos, buttonMask);
}
-int EmulateMB::createButtonMask(uint8_t buttonMask)
+int EmulateMB::createButtonMask(uint16_t buttonMask)
{
// Unset left and right buttons in the mask
buttonMask &= ~0x5;
diff --git a/vncviewer/EmulateMB.h b/vncviewer/EmulateMB.h
index 1afa4881..127c34a4 100644
--- a/vncviewer/EmulateMB.h
+++ b/vncviewer/EmulateMB.h
@@ -26,22 +26,22 @@ class EmulateMB : public rfb::Timer::Callback {
public:
EmulateMB();
- void filterPointerEvent(const rfb::Point& pos, uint8_t buttonMask);
+ void filterPointerEvent(const rfb::Point& pos, uint16_t buttonMask);
protected:
- virtual void sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask)=0;
+ virtual void sendPointerEvent(const rfb::Point& pos, uint16_t buttonMask)=0;
void handleTimeout(rfb::Timer *t) override;
private:
- void sendAction(const rfb::Point& pos, uint8_t buttonMask, int action);
+ void sendAction(const rfb::Point& pos, uint16_t buttonMask, int action);
- int createButtonMask(uint8_t buttonMask);
+ int createButtonMask(uint16_t buttonMask);
private:
int state;
- uint8_t emulatedButtonMask;
- uint8_t lastButtonMask;
+ uint16_t emulatedButtonMask;
+ uint16_t lastButtonMask;
rfb::Point lastPos, origPos;
rfb::Timer timer;
};
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index 9d71a859..6cda65e9 100644
--- a/vncviewer/Viewport.cxx
+++ b/vncviewer/Viewport.cxx
@@ -606,6 +606,20 @@ int Viewport::handle(int event)
if (Fl::event_button3())
buttonMask |= 1 << 2;
+ // The back/forward buttons are not supported by FTLK 1.3 and require
+ // a patch which adds these buttons to the FLTK API. These buttons
+ // will be part of the upcoming 1.4 API:
+ // * https://github.com/fltk/fltk/pull/1081
+ //
+ // A backport for branch-1.3 is available here:
+ // * https://github.com/fltk/fltk/pull/1083
+#if defined(FL_BUTTON4) && defined(FL_BUTTON5)
+ if (Fl::event_button4())
+ buttonMask |= 1 << 7;
+ if (Fl::event_button5())
+ buttonMask |= 1 << 8;
+#endif
+
if (event == FL_MOUSEWHEEL) {
wheelMask = 0;
if (Fl::event_dy() < 0)
@@ -660,7 +674,7 @@ int Viewport::handle(int event)
return Fl_Widget::handle(event);
}
-void Viewport::sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask)
+void Viewport::sendPointerEvent(const rfb::Point& pos, uint16_t buttonMask)
{
if (viewOnly)
return;
@@ -790,7 +804,7 @@ void Viewport::flushPendingClipboard()
}
-void Viewport::handlePointerEvent(const rfb::Point& pos, uint8_t buttonMask)
+void Viewport::handlePointerEvent(const rfb::Point& pos, uint16_t buttonMask)
{
filterPointerEvent(pos, buttonMask);
}
@@ -937,6 +951,8 @@ int Viewport::handleSystemEvent(void *event, void *data)
(msg->message == WM_RBUTTONUP) ||
(msg->message == WM_MBUTTONDOWN) ||
(msg->message == WM_MBUTTONUP) ||
+ (msg->message == WM_XBUTTONDOWN) ||
+ (msg->message == WM_XBUTTONUP) ||
(msg->message == WM_MOUSEWHEEL) ||
(msg->message == WM_MOUSEHWHEEL)) {
// We can't get a mouse event in the middle of an AltGr sequence, so
diff --git a/vncviewer/Viewport.h b/vncviewer/Viewport.h
index 5f4c1ca7..c5222a88 100644
--- a/vncviewer/Viewport.h
+++ b/vncviewer/Viewport.h
@@ -70,7 +70,7 @@ public:
int handle(int event) override;
protected:
- void sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask) override;
+ void sendPointerEvent(const rfb::Point& pos, uint16_t buttonMask) override;
private:
bool hasFocus();
@@ -81,7 +81,7 @@ private:
void flushPendingClipboard();
- void handlePointerEvent(const rfb::Point& pos, uint8_t buttonMask);
+ void handlePointerEvent(const rfb::Point& pos, uint16_t buttonMask);
static void handlePointerTimeout(void *data);
void resetKeyboard();
@@ -111,7 +111,7 @@ private:
PlatformPixelBuffer* frameBuffer;
rfb::Point lastPointerPos;
- uint8_t lastButtonMask;
+ uint16_t lastButtonMask;
typedef std::map<int, uint32_t> DownMap;
DownMap downKeySym;