Answer the question
In order to leave comments, you need to log in
How to read data from the gamepad?
Good Khabrovites.
I have a gamepad that I would like to use to control my projects. Gamepad with mushrooms and buttons, like PS-shnogo. I sit and think: how to read what he sends via USB, so that later I can code the reader of his commands and use it for my own purposes. And if with buttons, more or less, it’s clear, then with fungi, not so much. There must be a range. In general, I really want to read what he sends to the computer, and then teach him how to read the program.
There are, of course, programs that reassign actions from the gamepad to the keyboard, but you need to implement everything in your project.
Thanks in advance for your replies.
Answer the question
In order to leave comments, you need to log in
Damn, why the complexity of divination xinput or direct?
write what kind of gamepad you have and everything will be clear immediately
If the gamepad supports XInput, then you can use the library of the same name included in the DirectX SDK. there is an example of using
http://www.codeproject.com/articles/26949/xbox-360-controller-input-in-c-with-xinput
Most likely it is a HID device, which means it sends the number of buttons and axes, as well as their state.
It is possible cross-platform and rather simply through SDL/Allegro.
USB is sniffed nicely by Wireshark.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question