Jump to content
  • Advertisement
Sign in to follow this  

Raw Input - Joystick data format / Joystick layout

This topic is 2345 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Microsoft's Raw Input gives us a structure for mouse and keyboard inputs. But for joysticks, the data is plain binary. Is there a way to interpret that data without having to guess? A lot of games can list your joysticks and its buttons and axis (and sometimes even name them). So there must be a way to get this information. The top level collection can easily be probed by using GetRawInputDeviceInfo() and then looking into the RID_DEVICE_INFO.hid.usUsagePage and usUsage. Joysticks are 0x04 and I guess there must be a way to know that a joystick has x axis (usages from 0x30 to 0x35) and y buttons. That way I can interpret what the binary data means. The outputed data looks like this (for my joystick): 0x00 0x80 0x80 0x80 0x80 0x08 0x00 0x44 0xfd I know that octets from 1 to 4 are axix and the rest are buttons. But that's a guess which is made for my joystick. Thanks for any help you can give me.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!