Ports and Interfaces => General Discussion => Topic started by: jserran on December 04, 2013, 08:12:01 pm

Title: Custom game controllers and drivers
Post by: jserran on December 04, 2013, 08:12:01 pm
Not sure if this is too much of a software problem but hopefully I can find some help  :)
I am attempting to use input from a non-standard Xbox 360 controller on PC.
It is a skateboard controller with inputs that don't fully map on to a gamepad by default, giving only partial information on PC. It was released for the Tony Hawk : Ride game.

After figuring out the format of the reports sent by the controller, I thought the next step would be to write a driver to re-map the inputs to a custom mapping somehow.
Wireless controllers connecting through the dongle do not seem to have drivers though, which I don't understand.

I am also not sure about how information is passed through from the dongle, so I'm hoping it just manages connected devices without touching the data. I haven't been able to have a go capturing reports from the actual controller yet unfortunately.

I have been trying to learn how HID devices and drivers work but it seems a big topic I am quite unfamiliar with and I'm finding it hard to locate useful information.

So what I am looking for is a good resource/explanation of what goes on between devices and the OS, and how I might start developing in that environment.
Or any help anyone can offer really  ???
Title: Re: Custom game controllers and drivers
Post by: Jan Axelson on December 05, 2013, 10:40:05 am
You can view the report data with a protocol analyzer:


A protocol analyzer that shows enumeration will also show the report descriptor, or you can get this information using an application that retrieves the Capabilities structure:


An upper filter driver can intercept the data received from the controller. Here is an example:


You could also look into DirectInput:


or raw input:


to see if they offer any solutions.
Title: Re: Custom game controllers and drivers
Post by: jserran on December 09, 2013, 06:08:43 am
Thanks for you reply.
I believe the controller doesn't have a report descriptor like the standard 360 controller (as I understand it), though I will check when I can. The packets seem to be badly formatted as well.

If I could just use a custom descriptor to map the data to a HID Gamepad structure everything would just work. Is there any way to do this, or is it happening at too low a level to override?
I couldn't find info on the net for doing that on Windows.

Will check out WDK and Raw Input for now and hopefully I'll be able to come up with something.
Title: Re: Custom game controllers and drivers
Post by: Jan Axelson on December 09, 2013, 12:36:49 pm
Every USB HID-class device has a report descriptor.

If you want to remap the received data, use a filter driver.