Merge pull request #18244 from wwmayer/space_mouse_runtime

Gui: Add runtime check to choose between modern and legacy space mous…
This commit is contained in:
Chris Hennes
2024-12-09 11:36:17 -05:00
committed by GitHub
7 changed files with 141 additions and 68 deletions

View File

@@ -560,8 +560,15 @@ Application::Application(bool GUIenabled)
_pcWorkbenchDictionary = PyDict_New();
#ifdef USE_3DCONNEXION_NAVLIB
// Instantiate the 3Dconnexion controller
pNavlibInterface = new NavlibInterface();
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/View");
if (!hViewGrp->GetBool("LegacySpaceMouseDevices", false)) {
// Instantiate the 3Dconnexion controller
pNavlibInterface = new NavlibInterface();
}
else {
pNavlibInterface = nullptr;
}
#endif
if (GUIenabled) {
@@ -2295,7 +2302,9 @@ void Application::runApplication()
Gui::getMainWindow()->setProperty("eventLoop", true);
#ifdef USE_3DCONNEXION_NAVLIB
Instance->pNavlibInterface->enableNavigation();
if (Instance->pNavlibInterface) {
Instance->pNavlibInterface->enableNavigation();
}
#endif
runEventLoop(mainApp);