get 3Dxware control panel Settings for application

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

Moderator: Moderators

Post Reply
user69
Posts: 4
Joined: Thu Sep 20, 2007 4:15 am

get 3Dxware control panel Settings for application

Post by user69 »

Hello,

how can I display my Software with the right name in the 3Dxware control panel and get the settings (like which axis should be used for zoom) form there?

Any code Example? I could not find anythink for this topic in the sdk.

Thanks
User69
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi User69,

I assume you have your own application that you are incorporating support for the 3Dx devices in. If you want to display your application name in the control panel and have your own application specific settings, the easiest way is to add a config file for your application. It will then be chosen by the driver when your application runs.

At minimum, follow these steps:

1) Make a copy of any.scg in the driver's default profiles directory with a name specific to your app (your_own_app_name.scg). By default the profiles (configs) are in
C:\Program Files\3Dconnexion\3Dconnexion 3DxWare\en_us\profiles\default on an English system

2) Change the APPLICATION_NAME field to the name of your application. This is the string that will appear in the GUI.

3) Change the EXECUTABLES field to the executable name of your application.

4) Stop and restart the driver, then start your application and choose your profile from the list in the driver's GUI. The driver will remember that association after this (in the registry).

Jim
3Dx Software Development
user69
Posts: 4
Joined: Thu Sep 20, 2007 4:15 am

Post by user69 »

Thanks that works for myself (I asume, but need to test), but how do I need to do this, when I distibute my Application to customers?

There are 2 major problems, I see:
1. I need to install this config file with my program. But there are special cases:
- no space mouse present, so I cant install this file properly
-space mouse installed after my program
How to handle this?
2. I like to distribute the Viewer as standalone exe, without any installation, so I'm unable to install such a file. I also cant wite to your specified directury form my progam to simply create such a file, because of user privileges.
How to handle this?

Another question:
Does the Driver automatically changes the axes, when I change the 2 modes for zoom Y or Z direction, or do I need to do this from my program? If I need to do this from my Program, how to figure out which setting is choosen?

User69
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi user69,

The driver swaps the axes internally when the user changes the zoom direction. There is nothing you need to do.

You can handle all the installation issues with an MSI, but it's a whole new world to learn. Also you would indeed have permissions issues writing into Program Files, especially on Vista.

This brings up the question of whether you really want to distribute a config file. Generally we try to get applications to just use the any.scg configuration. It doesn't display nice command labels on the SpacePilot (or GUI), but at least there is no installation required. In this case, the device is just a simple input device, as it should be. All button events are sent directly on to your application.

There is a sync mechanism (for sending and getting settings from the driver) in the old SDK (archive section of the download page), but it isn't COM and it still requires a config file.

I suggest that if you want to be a simple single download, you allow the driver to just use the default any.scg for your app and bring up your own simple GUI to assign buttons to specific application commands if you have that need.

Jim
3Dx Software Development
user69
Posts: 4
Joined: Thu Sep 20, 2007 4:15 am

Post by user69 »

Thanks for the help.

So for me it seams to be the only possibility to deal without a own application config file (not the best solution, but the only possible).

Suggestion: Shouldn't it be possible to save a config file an the own program directury (or any other) an tell the driver to use this. So we do not have the problem with the user privileges and it works to, if you install the space mouse after your application. Otherwhise it always can make problems (especially under Vista and later).

One mor question: Does it helps that a user saves a config file with the name of my application to always load this config file via API LoadPreferences? (my progam does not have a fixed name for the exe - user dependend-, but I always use the same LoadPreferences('myApp').

Thank you
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi user69,

All associations with a configuration and the executable name are kept in the registry in HKCU. Also, the userXX.scg (user custom config files) are kept in %APPDATA%3dconnexion\3dxware\profiles. Your users could have access to these areas. You could have them run a script to setup your preferences.

Take a look in HKCU/software/3dconnexion/3dxware/Applications and you'll see the associations between all the apps you have run and the last used config file.

I don't think the driver will read anything except userXX.scg style names from %APPDATA%, but if you can find an unused userXX.scg you can use it.

Jim
3Dx Software Development
Post Reply