Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2019-11-08 10:47:57 +0300
committerEnrico Turri <enricoturri@seznam.cz>2019-11-08 10:47:57 +0300
commit68d6a458150ea194a9202853b106bc8d4b286ca6 (patch)
treed0b3b23c434a40e96232bf7cec35e7118772f286 /src/slic3r/GUI/Mouse3DController.cpp
parent55a4b99e44ea544612125ef3fb475a73579514f1 (diff)
3D connexion devides -> Added handling of 3 bytes long button packets
Diffstat (limited to 'src/slic3r/GUI/Mouse3DController.cpp')
-rw-r--r--src/slic3r/GUI/Mouse3DController.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/slic3r/GUI/Mouse3DController.cpp b/src/slic3r/GUI/Mouse3DController.cpp
index 78c0b6227..96ef4f664 100644
--- a/src/slic3r/GUI/Mouse3DController.cpp
+++ b/src/slic3r/GUI/Mouse3DController.cpp
@@ -569,6 +569,9 @@ void Mouse3DController::collect_input()
updated = handle_packet(packet);
else if (res == 13)
updated = handle_wireless_packet(packet);
+ else if ((res == 3) && (packet[0] == 3))
+ // On Mac button packets can be 3 bytes long
+ updated = handle_packet(packet);
#if ENABLE_3DCONNEXION_DEVICES_DEBUG_OUTPUT
else if (res > 0)
std::cout << "Got unknown data packet of length: " << res << ", code:" << (int)packet[0] << std::endl;
@@ -599,7 +602,8 @@ bool Mouse3DController::handle_packet(const DataPacket& packet)
}
case 3: // Button
{
- if (handle_packet_button(packet, 6))
+ unsigned int size = packet.size();
+ if (handle_packet_button(packet, packet.size() - 1))
return true;
break;