Controlling SpaceNavigator LEDs over HID

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

Moderator: Moderators

Post Reply
AlexH
Posts: 4
Joined: Mon Jun 23, 2008 7:46 pm

Controlling SpaceNavigator LEDs over HID

Post by AlexH »

Hey all,

I'm currently accessing the SpaceNavigator using the WM_INPUT method, and that works very well. Unfortunately, since the driver is never loaded, the LEDs are always turned off. I'd like to control them.

And there's the problem - I have exactly zero experience with HID programming. So as far as I could gather from MSDN, I have to send some kind of HID report (which looks like a binary stream) to the device using WriteFile. Unfortunately that's about as far as I got. There seem to be a lot of conflicting information on how exactly that report has to look like, how it has to be built, send to the device, etc. I tried lots of different approaches, and all failed.

I'm a little lost right now, to be honest. So any help on how exactly I can control these LEDs would be very much appreciated !

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

Post by jwick »

There are some HID programming examples on:

ftp:/ *** ***
login: ***
password: ***



Moderator Edit: the sample code is no longer available from the FTP service. Please contact 3Dconnexion API Support if you need further assistance.
AlexH
Posts: 4
Joined: Mon Jun 23, 2008 7:46 pm

Post by AlexH »

Ah, I didn't notice the rezero example. Modifying it for LEDs did the trick. Thanks !

However, I still have a question. As I mentioned, I'm using the raw input method to get the controller state. I support multiple controllers, ie. enumerate available raw input devices with the right vendor and product IDs, and let the user pick the one he wants to use with our product. I then only process WM_INPUT message originating from the corresponding input handle.

Of course I'd like to enable the LEDs for the selected controller only. But right now, I can't find a way to match the devices I get from the raw input device enumeration (GetRawInputDeviceList) with the HID enumeration (as in the rezero example). There is just no common data to compare: the returned device handles are incompatible, and the VID/PID are not enough to differentiate two identical devices.

Is there some kind of serial ID one could use, or somehow match both enumerations for identical devices ?

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

Post by jwick »

Hi Alex,

That is one of the problems we've identified with Raw Input. I don't know of a solution yet.

Jim
3Dx Software Development
AlexH
Posts: 4
Joined: Mon Jun 23, 2008 7:46 pm

Post by AlexH »

Hmm, I see. Well, it isn't that much of a problem really. But it would still be very convenient to somehow being able to match the devices in a future driver or product revision (although I guess this is more a limitation of MS' current rawinput API, which looks very limited in terms of returned device information).

Thanks for your help,
Alex
Post Reply