From c40d8a4debbfbf98045ef25fcac91672f0cc1049 Mon Sep 17 00:00:00 2001 From: Adam Halim Date: Fri, 4 Oct 2024 10:09:36 +0200 Subject: vncviewer: support for back/forward mouse buttons This commit implements the pseudo-encoding ExtendedMouseButtons which makes it possible to use the back/forward mouse buttons. This commit contains work originally done by PixelSmith . --- vncviewer/EmulateMB.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vncviewer/EmulateMB.cxx') 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; -- cgit v1.2.3