How is joystick axis information formatted from a USB Joystick?

Posted by aquanar on Stack Overflow See other posts from Stack Overflow or by aquanar
Published on 2010-03-26T16:00:44Z Indexed on 2010/03/26 16:03 UTC
Read the original article Hit count: 365

Filed under:
|
|

I actually just have a rather small question, but I have had the HARDEST time finding information about it.

For the application I am programming for, there will be a 3-axis joystick being connected via USB to a Windows XP computer, and it is being handled by directx. That information will then be sent elsewhere to an embedded controller. I don't need to know too much of the intricacies of how directx handles it, but I want to know, how is the data for the axes formatted?

Nearest I can tell, most joysticks nowadays have 12 bits of resolution, so is the data output as a 12-bit 2's compliment number? And after that, is it represented as a signed 16-bit integer when it is captured from directx?

I'd like to know this so I know how I will work with the data at the embedded platform side, such as how to format the packets sending data to the embedded side, as well ashow to use the information once it is on the embedded side.

© Stack Overflow or respective owner

Related posts about joystick

Related posts about directx