DirectInput Programming Examples

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

Moderator: Moderators

DeeMAGE
Posts: 20
Joined: Fri Nov 05, 2010 5:35 am
Location: UKRAINE

Post by DeeMAGE » Thu Nov 11, 2010 5:29 am

jwick wrote:You have to use DIPROPAXISMODE_ABS for the SpacePilot PRO. (Correction (21-Mar-2013): use DIPROPAXISMODE_REL)
That is! But do we need _ABS for SpacePilot only?
Can you provide an official information on that.
Thanks!

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

Post by jwick » Thu Nov 11, 2010 7:14 am

You need _ABS (Correction (21-Mar-2013): use DIPROPAXISMODE_REL) for the SpacePilot PRO and all future devices. The older devices need _REL (Correction (21-Mar-2013): use DIPROPAXISMODE_ABS). The device HID descriptor has changed, starting at the SPP.

It is best that you explicitly check for the older devices (SpaceNavigator, SpaceNavigator for Notebooks, SpaceExplorer, SpacePilot) and assume that all future devices, that you can't explicitly check for, are all _ABS.

DeeMAGE
Posts: 20
Joined: Fri Nov 05, 2010 5:35 am
Location: UKRAINE

Post by DeeMAGE » Thu Nov 11, 2010 7:49 am

Okay, if we should check DIPROP_INSTANCENAME, could you list here the possible strings that will match to devices operating in old DIPROPAXISMODE_REL mode?
Thank you.

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

Post by jwick » Thu Nov 11, 2010 8:08 am

I'd key off the Product ID, not the name. Unfortunately, I haven't looked at that code in quite a while to see how easy it is to get.

The Product ID and Vendor ID are in the first part of the GUID though:
c626046d-xxxxxx

c626 is the SpaceNavigator Product ID (PID).
046d is the 3Dconnexion/Logitech Vendor ID.

21-Mar-2013: The 3Dconnexion Vendor ID is 0x256f. New devices will use this Vendor ID.

The other PIDs are:
c625 SpacePilot
c627 SpaceExplorer
c628 SpaceNavigator for Notebooks
c629 SpacePilot PRO

(I need to update that sample code to reflect this)

DeeMAGE
Posts: 20
Joined: Fri Nov 05, 2010 5:35 am
Location: UKRAINE

Re: DirectInput Programming Examples

Post by DeeMAGE » Wed Mar 20, 2013 4:07 am

What about SpaceMousePro PID? Does it work in _ABS mode or you have additional changes?
Thanks.

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

Re: DirectInput Programming Examples

Post by jwick » Wed Mar 20, 2013 5:45 am

SpaceMouse Pro PID = 0xc62b
Use DIPROPAXISMODE_ABS. (Correction (21-Mar-2013): use DIPROPAXISMODE_REL)

DeeMAGE
Posts: 20
Joined: Fri Nov 05, 2010 5:35 am
Location: UKRAINE

Re: DirectInput Programming Examples

Post by DeeMAGE » Wed Mar 20, 2013 5:57 am

jwick wrote:SpaceMouse Pro PID = 0xc62b
Use DIPROPAXISMODE_ABS. (Correction (21-Mar-2013): use DIPROPAXISMODE_REL)
Thank you for that.
The problem reported by our user that it did rotation all the time (DirectInput only).
Do we need some additional settings for that model, or it's a bug somewhere?

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

Re: DirectInput Programming Examples

Post by jwick » Wed Mar 20, 2013 7:14 am

DeeMAGE wrote: The problem reported by our user that it did rotation all the time (DirectInput only).
Do we need some additional settings for that model, or it's a bug somewhere?
What do you mean by that? It doesn't do translation? It just rotates all the time even if the user isn't touching it? It does all 6DOF all the time? What happens if the user disconnects and reconnects it?

DeeMAGE
Posts: 20
Joined: Fri Nov 05, 2010 5:35 am
Location: UKRAINE

Re: DirectInput Programming Examples

Post by DeeMAGE » Wed Mar 20, 2013 9:11 am

It just rotates all the time even if the user isn't touching it.
Works fine in DI8ExamplePoll.exe example with DIPROPAXISMODE_REL.

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

Re: DirectInput Programming Examples

Post by jwick » Thu Mar 21, 2013 7:49 am

Well obviously I've lost my mind (or just reading my incorrect posts above rather than looking at my own code).

You do have to use DIPROPAXISMODE_REL for SPP, SMP, SN, SE and future devices. OTOH, it doesn't work great. The values accelerate very quickly way out of control. Perhaps there is something else we need to do in that sample code to stop that.

Speaking of future devices, 3Dconnexion is no longer using the Logitech Vendor ID. You also have to check for the 3Dconnexion Vendor ID, which is 0x256f.

Future devices also have a different report format, but DI seems to handle that fine.

DeeMAGE
Posts: 20
Joined: Fri Nov 05, 2010 5:35 am
Location: UKRAINE

Re:

Post by DeeMAGE » Thu Mar 21, 2013 8:10 am

jwick wrote:You have to use DIPROPAXISMODE_ABS for the SpacePilot PRO.
jwick wrote:You do have to use DIPROPAXISMODE_REL for SPP, SMP, SN, SE and future devices.
So which mode do we have to use, ABS or REL?

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

Re: DirectInput Programming Examples

Post by jwick » Thu Mar 21, 2013 8:17 am

_REL. OK. I'll go edit those incorrect posts....

DeeMAGE
Posts: 20
Joined: Fri Nov 05, 2010 5:35 am
Location: UKRAINE

Re: DirectInput Programming Examples

Post by DeeMAGE » Thu Mar 21, 2013 8:45 am

jwick wrote:_REL. OK. I'll go edit those incorrect posts....
Well if you look at my initial post, SpacePilot PRO does not work in REL mode, it works fine in ABS only...

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

Re: DirectInput Programming Examples

Post by jwick » Thu Mar 21, 2013 9:19 am

DeeMAGE wrote:
jwick wrote:_REL. OK. I'll go edit those incorrect posts....
Well if you look at my initial post, SpacePilot PRO does not work in REL mode, it works fine in ABS only...
Interesting. The SPP does not work at all well for me in _ABS mode. It acts like a joystick centered at 32k, which is what I would expect.
We will have to dig a little deeper to find out what is going on.
What OS are you on?
What version of DX?
What 3DxWare driver, if any, version?

DeeMAGE
Posts: 20
Joined: Fri Nov 05, 2010 5:35 am
Location: UKRAINE

Re: DirectInput Programming Examples

Post by DeeMAGE » Thu Mar 21, 2013 9:39 am

jwick wrote:It acts like a joystick centered at 32k, which is what I would expect.
Yes, we use DIJOYSTATE structure to get the data from it. Do we miss something?

Post Reply