Reading sensitivity setting

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

Moderator: Moderators

Post Reply
dirk2702
Posts: 3
Joined: Fri Apr 16, 2010 11:56 am

Reading sensitivity setting

Post by dirk2702 »

Hello,

can anyone provide me with a simple example of how to read the sensitivity setting from a SpacePilot Pro or at least how to use the Sync API in general? I am writting an Win32 C++ application. There is no problem with connecting with the device, but I have no idea how to use the Sync API. The "GUISync_SDK" example isn't much help for me to be honest.

I think I have to add, that I am not that experienced in writing C++ code :-( I usually use C# and Delphi.

Thanks in advance,
Dirk.
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Yes, GUISync_SDK is ridiculously overly complex. I need to rewrite it and throw out 90% of the code.

To get the overall scale factor, after you have opened the device with SiOpen, use the returned SiHdl to call SiSyncGetOverallScale. That will give you the scale factor from the scg file that is applied to every axis. If you want any of the individual axes, call SiSyncGetScaleTx (y, z, whatever).

Each of the SiSync functions basically just allow you to read and set values in the scg file, as if you were parsing it yourself.

Does that help?

More importantly, why do you want these scale factors? They are purely a user override.

With all that being said, we are strongly encouraging people to switch their code to one of the Microsoft APIs, such as Raw Input. See our Standard 3D Mouse SDK page.
dirk2702
Posts: 3
Joined: Fri Apr 16, 2010 11:56 am

Post by dirk2702 »

Thank you for your help. I just figured it out myself... :-) After a whole day without any success :-(

The functions SiGetEventWinInit and SiGetEvent did the trick. Using the SDK and Sync API isn't that complicated - if you know where to start. I needed the Sync API and all that is available as an example is the GUISync_SDK :-( Two dozen source files gave me a headache but not the slightest idea what to do.

I use the SPP for controlling two 3 axis motor controller using a C# application. The sensitivity is set with buttons on the SPP and I display it among other values on the LCD display. For accessing the display and retrieving the sensitivity value I use C++.

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

Post by jwick »

Yeah, I know. It gives me a headache every time I look at it too. It is basically a test program that exercises everything in the sync API to make sure it works. Not a good example. I'm not sure what its long term life cycle is.

You are correct, you need to use SiGetEvent to get the SiSync calls to work. I thought I mentioned that in the doc. I may have just assumed it, since that has always been the only way to get data from the device. It becomes an issue if you would try to use it for output only.

You could read the device with C# and Raw Input, but that might just complicate things. The approach you are using is fine for now. You can of course write your own nifty SPP applet to display anything you want on the SPP LCD. That's why we used the Logitech LCD technology.
Post Reply