modelica-3rdparty/Modelica_DeviceDrivers

Spacemouse not working under Windows 10

Closed this issue · 8 comments

When using the MDD Block for the 3DConnexion SpaceMouse on Windows 10, the block doesn't get the inputs from the SpaceMouse (it just returns zeros).

The problem is that the length of the list of scanned potentially relevant USB devices is limited by a too low hard-coded value:

At least for some of our Windows 10 systems the list needs to be longer, otherwise the SpaceMouse device will not appear in the list.

Still need to provide the updated binaries

tbeu commented

This requires new binaries MDDSpaceMouse.[lib, dll, a], right?

Yes, I just pushed a VS 2010 generated .lib and .dll using an old Windows Driver Kit (WDK) that I still have at home (Version 7.1.0) for backwards compatibility. Can't check if it works here (no SpaceMouse at home), but will check it tomorrow in my office. It is not needed to update the Linux binaries, since the changes are only for Windows.

tbeu commented

The updated MDDSpaceMouse.dll (both win32 and win64) does not export MDD_spacemouseGetData.

Thanks for spotting this error. Should be fixed with f6f10fc.

tbeu commented

Is this issue really specific for Win10?

No, not really specific to Win10. The issue with the previous code was that it limited the number of HID devices that were checked for being a SpaceMouse at a (too low) max value. For some reason that seems to be (usually?) no problem in Windows 7, but in Windows 10 the SpaceMouse appeared at an index that was not checked anymore. I've simply increased this max value from 10 to 50. This seems to be enough (though maybe there exists configurations there this is too low). It's a quick fix that got it working. It's probably not a super solid solution. I don't really want to invest too much time trying to understand the details of this Windows driver API, but I'm of course open if there are suggestions for a better solution.