Add 3D mouse speed, direction, dead zone and twist-to-zoom settings

The 3D mouse's pan and zoom speeds were fixed guesses, and each sample
was applied as it came, so the speed on screen depended on how often
the driver sends samples -- different for every platform and device.

Motion now goes through SpaceMouseMotion::map(), which scales each
sample by the time since the previous one, and applies the user's
settings from a new "Mouvement" section of Configuration > Souris 3D:
pan and zoom speed, a dead zone, inverting each axis, and zooming by
push/pull (as before) or by twisting the cap. The defaults keep the
previous behaviour. Zoom is now exponential in the deflection, so the
factor stays positive however hard the cap is pulled (1 + z/1000 went
negative past z = -1000) and an equal push and pull cancel out. Sub-
pixel pan is carried over between samples instead of being rounded
away. The backend now reports all six axes.

tst_spacemousemotion covers the mapping without a device and is built
whether or not QET_ENABLE_SPACEMOUSE is on. The new behaviour was also
checked end to end with tools/spnav-shim (qelectrotech-docker): twist
with a dead zone of 10 ignores push/pull and small drift, and a twist of
60 gives the same frame as a push of 50 with the defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-09-25 09:56:04 +12:00
parent 04e2279a7f
commit 17ebbffbca
12 changed files with 750 additions and 81 deletions
+6
View File
@@ -2231,6 +2231,12 @@ void QETApp::configureQET()
// affiche le dialogue puis evite de le lier a un quelconque widget parent
cd.exec();
cd.setParent(nullptr, cd.windowFlags());
#ifdef QET_SPACEMOUSE_SUPPORT
if (m_space_mouse_listener) {
m_space_mouse_listener->reloadSettings();
}
#endif
}
/**