Handmade Network»Forums
James Deeman
6 posts
HID information for controllers.
Edited by James Deeman on Reason: Initial post
Can anyone point me to a site where I can find HID information for the usb XBOX 360 controllers?

Bit of background; i'm sort of just starting on my 'handmade' journey and watching Handmade Hero, but I have a Mac and so i'm also following along with Ted Bendixson writeups (I'm also aware of Jeff Buck's github repo.)

Anyway, i'm at the point in the linked article where it talks about IO interfaces having HID information in order to determine what is being connected and pressed at a given time. It even links to a page where you can get this info for PS4 controllers (which I have but happened to have my 360 controller connected at the time). Some searching didn't turn up any information and I wondered if there was a place for this sort of thing, given that it must aid developers to support hardware.

Please let me know if i'm looking at this in the wrong way, or indeed if you have any information that can help me. I'm pretty sure I can just muddle through the article and get my controller working but it would be great to have a reference for this sort of thing.
Mārtiņš Možeiko
2559 posts / 2 projects
HID information for controllers.
Edited by Mārtiņš Možeiko on
Linux kernel soure code: https://github.com/torvalds/linux...ter/drivers/input/joystick/xpad.c
Shows exactly how to identify controllers, parse incoming HID packets, extract input values and apply rumble.

Alternatively SDL source code: https://hg.libsdl.org/SDL/file/e0220c4bc306/src/joystick/hidapi
James Deeman
6 posts
HID information for controllers.
Thank you very much for the links. I will do some reading and see if I can get my controller working.
James Deeman
6 posts
HID information for controllers.
If anyone else stumbles across this I referenced the CCController library on Github as it was more directly relevant to my code.
Ted Bendixson
28 posts / 2 projects
I make apps and games for Mac OS and iOS. Creator of Mooselutions and Skate Dice. Avid terrain park snowboarder. Charlottesville, VA.
HID information for controllers.
Interesting.

I remember just plugging in my Sony PS4 Dual Shock controller, putting a breakpoint in one of the IOHID callbacks, and then just checking the state when I pressed each button.

I did use CCController as a starting point but got rid of a bunch of extra stuff and took a more direct approach