Skip to content

Commit

Permalink
Fix of 3DConnexion 3D SpaceMouse Jumpy Pan moves on Linux #5233
Browse files Browse the repository at this point in the history
Also improved error reporting on Linux about the 3DConnexion device
access issues.
  • Loading branch information
bubnikv committed Dec 15, 2020
1 parent d59f345 commit aa8f97f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/slic3r/GUI/Mouse3DController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ bool Mouse3DController::State::apply(const Mouse3DController::Params &params, Ca
if (params.swap_yz)
rot = Vec3d(rot.x(), -rot.z(), rot.y());
camera.rotate_local_around_target(Vec3d(rot.x(), - rot.z(), rot.y()));
break;
} else {
assert(input_queue_item.is_buttons());
switch (input_queue_item.type_or_buttons) {
Expand Down Expand Up @@ -895,7 +894,10 @@ bool Mouse3DController::connect_device()
if (device.second.size() == 1) {
#if defined(__linux__)
hid_device* test_device = hid_open(device.first.first, device.first.second, nullptr);
if (test_device != nullptr) {
if (test_device == nullptr) {
BOOST_LOG_TRIVIAL(error) << "3DConnexion device cannot be opened: " << device.second.front().path <<
" You may need to update /etc/udev/rules.d";
} else {
hid_close(test_device);
#else
if (device.second.front().has_valid_usage()) {
Expand Down Expand Up @@ -940,10 +942,13 @@ bool Mouse3DController::connect_device()
break;
}
#endif // __linux__
else {
BOOST_LOG_TRIVIAL(error) << "3DConnexion device cannot be opened: " << data.path <<
" You may need to update /etc/udev/rules.d";
#if ENABLE_3DCONNEXION_DEVICES_DEBUG_OUTPUT
else
std::cout << "-> NOT PASSED" << std::endl;
#endif // ENABLE_3DCONNEXION_DEVICES_DEBUG_OUTPUT
}
}

if (found)
Expand Down

0 comments on commit aa8f97f

Please sign in to comment.