3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
wmayer
Site Admin
Posts: 16875
Joined: Thu Feb 19, 2009 10:32 am

Re: 3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Postby wmayer » Sun Oct 18, 2020 7:50 pm

Would it be an option (for the Windows version of FreeCAD) to integrate those devices more seamless (with the SDK from 3Dconnexion). As an alternative/additional method to RAW_INPUT - not as an replacement.
How does this SDK work? Does it have a header file and a library to link with or does it only have a shared library that has to be dynamically loaded?
The latter would be nice because then the package maintainers wouldn't need the SDK.
Or is it not worth to think about those things because of licensing problems or such things?
If the SDK is a single library without a header file then this shouldn't be a problem.
mike
Posts: 22
Joined: Thu Nov 06, 2014 12:06 pm

Re: 3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Postby mike » Sun Oct 18, 2020 9:36 pm

wmayer wrote:
Sun Oct 18, 2020 8:08 pm
Found something here:
[...]
Most of the above is (very) old stuff (i guess).

I took a first look at the recent version of the SDK.
There are a handful header files, and the samples link against a single (provided) *.lib
The actual framework is implemented in a single *.dll which is part of the 3Dconnexion driver.
Not sure if this leads us somewhere...?
wmayer
Site Admin
Posts: 16875
Joined: Thu Feb 19, 2009 10:32 am

Re: 3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Postby wmayer » Mon Oct 19, 2020 6:42 am

The actual framework is implemented in a single *.dll which is part of the 3Dconnexion driver.
When you use the tool Dependency Walker you can load the .dll into it. How does the function names look like?
User avatar
tanderson69
Posts: 1545
Joined: Thu Feb 18, 2010 1:07 am

Re: 3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Postby tanderson69 » Mon Oct 19, 2020 12:32 pm

IMHO: 3dconnexion has a long history of obsoleting devices. I personally would never use their software and become part of their "Planned obsolescence" scheme. If supporting the different devices is becoming too much inside freecad, I would suggest:
1) Add proper windows support to spacenav. Probably require an aggressive fork.
2) Add usb support to my spacemeld driver
3) Create another driver. The different protocols are pretty basic. Hard part, as you know, is all the different devices. This guy has most of the devices and is helpful.
wmayer
Site Admin
Posts: 16875
Joined: Thu Feb 19, 2009 10:32 am

Re: 3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Postby wmayer » Mon Oct 19, 2020 3:32 pm

tanderson69 wrote: This guy has most of the devices and is helpful.
On this page there is a link to a German SpaceMouse vendor and there is a list of supported applications: among them is FreeCAD 0.14-0.17 for Linux/macOS
mike
Posts: 22
Joined: Thu Nov 06, 2014 12:06 pm

Re: 3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Postby mike » Mon Oct 19, 2020 5:28 pm

tanderson69 wrote:
Mon Oct 19, 2020 12:32 pm
IMHO: 3dconnexion has a long history of obsoleting devices. I personally would never use their software and become part of their "Planned obsolescence" scheme.
That's a very good point. They do not even provide Linux/Unix drivers for recent devices anymore (as far as i know).

On the other hand... with the current "Raw Input"-approach FreeCAD (probably) has to be adapted for every single device out there - no matter if it's already there or released in the future.

spacenav seems to be the only alternative that is actively maintained at the moment. Does it support the SpaceMouse Enterprise on Linux (with the display/graphic icons and such)?
Anyway - I have a strong suspicion that a Windows driver works quite different in comparison to a linux daemon... ;) but it's probably worth to invest some spare time for a closer look.

Are there other alternatives / simpler approaches that i'm not aware of? More opinions?
mike
Posts: 22
Joined: Thu Nov 06, 2014 12:06 pm

Re: 3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Postby mike » Mon Oct 19, 2020 5:41 pm

wmayer wrote:
Mon Oct 19, 2020 6:42 am
When you use the tool Dependency Walker you can load the .dll into it. How does the function names look like?

Dunno, what exactly you're after.... here's a picture:

TDxNavLib_depends.png
TDxNavLib_depends.png (18.22 KiB) Viewed 147 times
wmayer
Site Admin
Posts: 16875
Joined: Thu Feb 19, 2009 10:32 am

Re: 3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Postby wmayer » Mon Oct 19, 2020 5:48 pm

mike wrote: They do not even provide Linux/Unix drivers for recent devices anymore (as far as i know).
The latest Linux driver is from June 2014.
On the other hand... with the current "Raw Input"-approach FreeCAD (probably) has to be adapted for every single device out there - no matter if it's already there or released in the future.
At least from time to time the raw event handling or the recognition as 3d device is quite different. I once had the fun task to make the old Magellan device working with FreeCAD: https://forum.freecadweb.org/viewtopic.php?f=13&t=28306

The relevant code is very different to the generic code we have for the newer models.
wmayer
Site Admin
Posts: 16875
Joined: Thu Feb 19, 2009 10:32 am

Re: 3DConnexion SpaceMouse - pressing ANY button dramatically zooms out and rotates the view

Postby wmayer » Mon Oct 19, 2020 6:19 pm

mike wrote:
Mon Oct 19, 2020 5:41 pm
wmayer wrote:
Mon Oct 19, 2020 6:42 am
When you use the tool Dependency Walker you can load the .dll into it. How does the function names look like?

Dunno, what exactly you're after.... here's a picture:
Thanks!

This comment is taken from the 3Dconnexion forum:
· SDK license no longer allows redistribution of DLL binary files (these are always included in the driver user installation).
If we linked the dll at build time (i.e. by using the import library) it would be a hard dependency and FreeCAD would only start if the dll is present -- independent of whether the users has a space mouse or not. So, we had to redistribute the dll with our installers but the SDK license actively disallows that.

So, technically the only option is to load the dll fully dynamically at runtime which means that the availability of the file is not mandatory. Luckily the dll offers a C-like interface (i.e. no C++ classes with name mangling) so that it is theoretically possible to get the input from there.