RawInput /Raw Input / WM_INPUT Examples

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

Moderator: Moderators

RawInput /Raw Input / WM_INPUT Examples

Postby jwick » Thu Jan 17, 2008 9:18 am

Edit: The new "Standard 3D Mouse" SDK (see here for 3Dconnexion provided code samples and guidance on how to support 3D mice using Raw Input).

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

ftp://ftp-us.3dconnexion.com/
login: examples
password: examples
jwick
Moderator
Moderator
 
Posts: 1756
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA

Postby markbeverley » Mon Jan 21, 2008 9:19 am

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

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

Postby 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.
znissan
User
User
 
Posts: 191
Joined: Tue Nov 28, 2006 12:32 pm
Location: San Jose, CA

Connection closed by remote host.

Postby 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

Postby 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
drstine
 
Posts: 2
Joined: Thu Jan 24, 2008 6:57 am
Location: Washington, DC

Postby 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.
jwick
Moderator
Moderator
 
Posts: 1756
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA

Postby 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!
Mathias
 
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Re: RawInput /Raw Input / WM_INPUT Examples

Postby UtaSH » Thu Apr 22, 2010 5:08 am

ftp://ftp-us.3dconnexion.com/examples
login: examples
password: examples


Hmm ... I could reach the ftp site with these details. When did you try it? Are you using an ftp client?
UtaSH
Moderator
Moderator
 
Posts: 1116
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany

Postby 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

Postby 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?
Mathias
 
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Postby jwick » Thu Apr 29, 2010 8:28 am

What about the Microsoft examples?

http://msdn.microsoft.com/en-us/library/ms645546(VS.85).aspx#buffered_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.
jwick
Moderator
Moderator
 
Posts: 1756
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA

Postby 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

Postby 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?
Mathias
 
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Postby 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.
jwick
Moderator
Moderator
 
Posts: 1756
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA

Postby Mathias » Thu Apr 29, 2010 11:55 am

That works pretty well for me. Thank you jwick.
Mathias
 
Posts: 11
Joined: Sat Sep 05, 2009 2:48 pm

Next

Return to Developer's Forum for Windows

Who is online

Users browsing this forum: No registered users and 1 guest