C# how to open Virtual 3D Mouse Commands

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
TadeuszWilczek
Posts: 1
Joined: Tue Jul 17, 2018 5:47 am

C# how to open Virtual 3D Mouse Commands

Post by TadeuszWilczek »

In documentation (SDK) is: "3Dconnexion recommends developers to code support for Virtual 3D Mouse Commands (V3DCMD)"
I analyze your sample code (TestSiapp) and this application does not use this feature. Your C++ sample application (3DxTest) uses this feature:

// Tell the driver we want to receive V3DCMDs instead of V3DKeys
SiOpenWinAddHintBoolEnum(&oData, SI_HINT_USESV3DCMDS, SPW_TRUE);

How can I use this feature in c#?
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: C# how to open Virtual 3D Mouse Commands

Post by jwick »

The implementation of the Hints in C# isn't trivial; I haven't gotten around to it yet. Sorry.

All you have to do is tell the driver you want to get V3DCMDs. There are other ways of doing that.
All the Hint for V3DCMDs does is choose a default cfg file for your app (AppDefCfg_S80_V3DCMDs.xml).

You can create an app-specific cfg file that does the same thing:
1) Make a copy of the AppDefCfg_S80_V3DCMDs.xml -> ("your app name".xml)
2) Change the ExecutableName value from missing to "your app name.exe".
3) Put the new file in %programdata%\3Dconnexion\3DxWare\Cfg (ProgramData not ProgramFiles)
4) Delete any cfg files in %appdata%\3Dconnexion\3DxWare\Cfg for your app that the driver may be using (they probably are named after your executable)
5) Restart the driver, and it should use your cfg (you can check by hovering over the 3Dx systray icon).

When the user presses buttons, your app should get sent generic V3DCMDs instead of the old device-specific button events. Your app is then [relatively] immune to hardware changes.

There is a possibility that you may need to remove the <Hints> section from your app-specific cfg file.
Post Reply