Register
handmade.network»Forums»HID information for controllers.
James Deeman
3 posts
HID information for controllers.
2 weeks, 1 day ago Edited by James Deeman on Sept. 15, 2020, 11:17 a.m. 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
2131 posts / 1 project
HID information for controllers.
2 weeks, 1 day ago Edited by Mārtiņš Možeiko on Sept. 15, 2020, 12:37 p.m.
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
3 posts
HID information for controllers.
2 weeks ago
Thank you very much for the links. I will do some reading and see if I can get my controller working.
James Deeman
3 posts
HID information for controllers.
2 weeks ago
If anyone else stumbles across this I referenced the CCController library on Github as it was more directly relevant to my code.