RawInput /Raw Input / WM_INPUT Examples

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

Moderator: Moderators

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

RawInput /Raw Input / WM_INPUT Examples

Post by jwick » Thu Jan 17, 2008 9:18 am

This ftp site contains examples of how to access the 3Dx devices via Raw Input (WM_INPUT).

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.

markbeverley
Posts: 1
Joined: Mon Jan 21, 2008 9:11 am

Post by markbeverley » Mon Jan 21, 2008 9:19 am

The FTP site seems to time out, is it down at the moment?

Mark

znissan
User
User
Posts: 191
Joined: Tue Nov 28, 2006 12:32 pm
Location: San Jose, CA
Contact:

Post by znissan » Tue Jan 22, 2008 1:44 am

Hello:

Our ftp server is in fact down due to a maintenance issue, but should be back up on Tuesday, January 22.

We apologize for the inconvenience and promise to have this fixed shortly. We'll post again when it is back up.

Ziva Nissan
3Dconnexion, Inc.

drstine
Posts: 2
Joined: Thu Jan 24, 2008 6:57 am
Location: Washington, DC

Connection closed by remote host.

Post by drstine » Thu Jan 24, 2008 7:19 am

Hi Ziva,

Is your FTP server still down? Or is it me?

Dan

drstine
Posts: 2
Joined: Thu Jan 24, 2008 6:57 am
Location: Washington, DC

Post by drstine » Wed Jan 30, 2008 10:55 am

Hi,

I downloaded your examples and got an application working with the WM_INPUT and GetRawInputData technique.

Just out of curiosity, has anyone gotten GetRawInputBuffer working?

I coded it as best I could from the MSDN examples/documentation, but it only returns 0. There is very little additional information posted on other forums.

Dan

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

Post by jwick » Wed Jan 30, 2008 11:21 am

Nope. I've never tried GetRawInputBuffer. Please let us know if you manage to get it working.

BTW, the ftp site is up now.

Mathias
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Post by Mathias » Thu Apr 22, 2010 4:10 am

Server seems to be down again. Can you send me the files or upload the somewhere else so that they are reachable?

Thanks a lot in advance!

UtaSH
Moderator
Moderator
Posts: 3285
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Re: RawInput /Raw Input / WM_INPUT Examples

Post by UtaSH » Thu Apr 22, 2010 5:08 am

ftp:/ *** ***
login: ***
password: ***
Hmm ... I could reach the ftp site with these details. When did you try it? Are you using an ftp client?


Moderator Edit: the sample code is no longer available from the FTP service. Please contact 3Dconnexion API Support if you need further assistance.

Mathias
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Post by Mathias » Thu Apr 22, 2010 7:28 am

Now it works. Seems as though that was a temporary problem.
Thanks for your help.

Mathias
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Post by Mathias » Thu Apr 29, 2010 8:18 am

I would also be very much interested in an example for GetRawInputBuffer().

The problem with the SpaceNavigator, providing input data is, that it sends a lot of data, so using GetRawInputData() makes applications go on executing on this data from 1 up to 5 seconds after you pulled your hand of the device.

Does anyone have experience with this?

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

Post by jwick » Thu Apr 29, 2010 8:28 am

What about the Microsoft examples?

http://msdn.microsoft.com/en-us/library ... fered_read

You do have to structure your program so that you don't do something time consuming everytime you get a data packet. The device will flood you with data at about 60Hz and you will quickly fall behind. You need to eat through all that data before you go do something complicated.

Mathias
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Post by Mathias » Thu Apr 29, 2010 9:28 am

In some cases doing complex calculations can't be avoided.

If so, it shouldn't be a problem, if the RawInput is always read as the complete available Buffer and everything is processed together.

Using the buffer we can work all waiting input reasonably together to one input command and then process simply this command.

The problem I have right now is, how to access this Buffer. Using the example from Microsoft doesn't work for me as the method always returns zero (like drstine also mentioned).

Mathias
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Post by Mathias » Thu Apr 29, 2010 9:34 am

If I get it right, the Buffered-Read example from Microsoft reades the data into an object called pri. How can I get the SpaceNavigator data out of this object?

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

Post by jwick » Thu Apr 29, 2010 9:52 am

I don't know what is wrong with their example (but there do seem to be some guesses in there about the amount of memory needed for the final call to GetRawInputBuffer). You'll have to take it up with them.

It does seems that they are just sitting in a loop collecting all the WM_INPUT events into an array for you each time you call GetRawInputBuffer. You could do that yourself, each time you get a WM_INPUT event (that is what we do in all our code).

if event == WM_INPUT
{
eventData = 0
while still WM_INPUT events in the message queue
{
eventData += next event data
}

Now that the message queue is empty, do something time consuming with eventData.
}


It doesn't seem much different from:
GetRawInputBuffer( buffer )
foreach(bufferEvent in buffer)
{
eventData += bufferEvent
}

Now do something time consuming with eventData.

You still have to go through all the events individually.

Mathias
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Post by Mathias » Thu Apr 29, 2010 11:55 am

That works pretty well for me. Thank you jwick.

Post Reply