Direct Input Example
Moderator: Moderators
Direct Input Example
Hi,
Anyone have any example of Direct Input with Space Navigator without windows???
I would like to use the Direct Input Example from a prompt, and only read the coordinates of Space Navigator, without showing them in a GUI. I need of their coordinates to use in the other application.
Thanks.
Anyone have any example of Direct Input with Space Navigator without windows???
I would like to use the Direct Input Example from a prompt, and only read the coordinates of Space Navigator, without showing them in a GUI. I need of their coordinates to use in the other application.
Thanks.
-
- Posts: 44
- Joined: Fri Apr 04, 2008 7:03 am
Hi,
I'm trying to addapt the HIDtest code to continuously get the rotation and translation parameters that are generated by the SpaceNavigator.
In the function call:
waitResult = WaitForMultipleObjects(_waitListIndex, _waitListHandles, FALSE, INFINITE);
from the example we're discussing, how can I change the parameter INFINITE so that it doesn't wait infinite time for a response from the device?
Or do I have to do any other modification to get what I want?
Thanks in advance.
I'm trying to addapt the HIDtest code to continuously get the rotation and translation parameters that are generated by the SpaceNavigator.
In the function call:
waitResult = WaitForMultipleObjects(_waitListIndex, _waitListHandles, FALSE, INFINITE);
from the example we're discussing, how can I change the parameter INFINITE so that it doesn't wait infinite time for a response from the device?
Or do I have to do any other modification to get what I want?
Thanks in advance.
-
- Posts: 44
- Joined: Fri Apr 04, 2008 7:03 am
jwick,
I've changed the parameter INFINITE to 0, but I still have to wait for an interaction to occur. I'm kind of lost here... I don't know which part of the following code makes my application wait for a sign of life from the device:
Please, help me out... All I wanted was to get the translation and rotation vectors, even if the device is not activated.
Thanks again.
I've changed the parameter INFINITE to 0, but I still have to wait for an interaction to occur. I'm kind of lost here... I don't know which part of the following code makes my application wait for a sign of life from the device:
Code: Select all
if (bRun) {
float vettranslacao[3], vetrotacao[3];
waitResult = WaitForMultipleObjects(_waitListIndex, _waitListHandles, FALSE, 0);
if (waitResult <WAIT_OBJECT_0> handle, pDev -> buf, pDev -> capabilities.InputReportByteLength, &nread, FALSE))
...
}
Thanks again.
The way you've changed the code, you should return immediately but you won't have any data most of the time.
You can't get the data if there isn't anything there to be got. If you want to get new data at any time and not be blocked in your main thread, you should run a separate thread that just reads the device and provides the data to the main loop of your app any time you need it.All I wanted was to get the translation and rotation vectors, even if the device is not activated
-
- Posts: 44
- Joined: Fri Apr 04, 2008 7:03 am