RawInput & Keys values

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

Moderator: Moderators

RawInput & Keys values

Postby matilla » Mon Jul 26, 2010 9:22 am

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

Postby matilla » Fri Feb 18, 2011 5:18 am

Please any solution? I'm at the same point
matilla
 
Posts: 7
Joined: Wed May 12, 2010 3:59 am

Postby ngomes » Fri Feb 18, 2011 8:14 am

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
ngomes
Moderator
Moderator
 
Posts: 1656
Joined: Mon Nov 27, 2006 7:22 am
Location: EU

Postby matilla » Mon Feb 21, 2011 8:30 am

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
matilla
 
Posts: 7
Joined: Wed May 12, 2010 3:59 am

Postby ngomes » Wed Feb 23, 2011 6:50 am

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.
ngomes
Moderator
Moderator
 
Posts: 1656
Joined: Mon Nov 27, 2006 7:22 am
Location: EU


Return to Developer's Forum for Windows

Who is online

Users browsing this forum: No registered users and 1 guest

cron