RawInput & Keys values

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

Moderator: Moderators

Post Reply
matilla
Posts: 7
Joined: Wed May 12, 2010 3:59 am

RawInput & Keys values

Post by matilla »

Hi,

I developed an application with one SpacePilot device that works properly thanks to your help.

The only thing I don't understand is the behaviour of the keys. I mean, when the action I do is just click the key 1, I receive a message (event->data.hid.bRawData[0] == 0x03) where its value is 1.
However, if I click the key1 while I am moving the axis joystick I get the same message but its value is a big number that changes every time.

How could I detect a Key1 click while I am moving the axis?

thanks,
mati
matilla
Posts: 7
Joined: Wed May 12, 2010 3:59 am

Post by matilla »

Please any solution? I'm at the same point
ngomes
Moderator
Moderator
Posts: 3458
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Post by ngomes »

Hi matilla,

Our apologies for not responding any sooner.

We believe the problem that you reported is an issue in the Raw Input framework: somehow button packets (ID 3) have data from a motion packet (ID 1 or 2) when the cap is being displaced.

We have a workaround for that issue in the latest SDK. You can download the SDK from here. Refer to the file rawinput.hpp.

In the SDK sample, our workaround is implemented by checking the state of only the buttons that, given the device type, are known to exist (we ignore the remaining data).

Future devices -- anything newer than the SpacePilot PRO -- shouldn't be affected as we will have ensured packets (regardless of type) have the same size. Less efficient for sure but it will be a more effective workaround.
Nuno Gomes
matilla
Posts: 7
Joined: Wed May 12, 2010 3:59 am

Post by matilla »

Thanks,

However, I'm not able to understand the code, what do sizeHid, nMaxCount variables mean?

I'm not using Visual studio, so I would like to migrate this code to my system.
Thanks in advance

matilla
ngomes
Moderator
Moderator
Posts: 3458
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Post by ngomes »

Hi matilla,

You can use the following button packet sizes:

SpacePilot PRO : 5 bytes (1byte ID + 32bit)
SpaceNavigator : 3 bytes (1byte ID + 16bit)
SpaceNavigator for Notebooks: 3 bytes (1byte ID + 16bit)
SpaceExplorer : 3 bytes (1byte ID + 16bit)
SpacePilot : 4 bytes (1byte ID + 24bit)

Devices can be identified using the USB vendor ID (VID) and product ID (PID) numbers. These can be retrieved using GetRawInputDeviceInfo().

3Dconnexion uses the 0x046D VID. For PID information, refer to this FAQ article. For example, the SpaceNavigator has a PID of 0xC626.
Post Reply