Writing a game controller driver for some hardware connected via USB
Asked Answered
S

1

16

I'm looking to create a driver for a game controller I have (a cobalt flux www.cobaltflux.com ). The physical controller itself has nine face buttons and two control-box buttons (start/select). The control box has a usb port, but as far as I can tell no one has ever written drivers for it before. The end result I want is to be able to plug in the cobalt flux via the usb port and have windows recognize it as a game controller.

I have some programming experience. I'm a senior undergraduate student in computer science at UC Davis and an intern at a large embedded systems company, however this project involves several aspects I have no experience in: interfacing hardware and software via a USB port, investigating feedback from hardware I didn't build (which bits light up when I press a button?), and creating drivers and indeed programs in general for windows.

Since I don't personally know anyone who would be able to set me on the right track for a workflow to solve this problem, I'm asking here. I imagine the approach going something like:

I connect the device via a usb

I open up a program to poll what the effects of pushing buttons are on the USB channel

I write a program that interfaces those signals from the USB port to the game controller drivers that windows has

It may be worthwhile to note that I need to have joyPAD support and not joySTICK support for the buttons since play will involve pressing down any number of buttons at once and joysticks generally only register one direction of input at any given time.

Any advice or help would be greatly appreciated. I am having trouble figuring out where to start.

Sarver answered 19/7, 2013 at 21:53 Comment(3)
Voting to close as unclear or too broad.Individual
I'm having a similar question, and don't feel it's too broad or unclear. I have a Logitech Steering Wheel controller that is not supported in W8 or W10. It recognizes it, but does not read any input. I simply want to write something that will listen on that USB port and then allow me to map that information to a game controller interface.Lonely
Also interested in an answer to this. Voting NOT to close.Jacinda
F
7

I have exactly the same problem for more than a year now and I did not found the right solution yet.

When you plug in the pad via USB it announces with a device ID and a vendor ID which device it is. Windows Plug-and-Play starts searching for a driver. This mechanism spots it is a pointing device (in my case one or 2 mice) and makes sure that it is treated as a raw data input device. Input from these devices is converted to messages handled by the OS. The solution seems to be to pass the messages of such a raw input device to the right handler. In my case the two mice are both recognised as mice and the messages are used by the same handler as the ones coming from the 3rd mouse that is really my pointing device. I am not experienced enough in C++ coding in order to dig into the rawinput API. I just received an interesting link as answer on my question: http://www.icculus.org/manymouse/ at least this gives an answer on my problem. May be it will give you ideas for writing your driver! Good luck !!! Stefan

Flavone answered 19/8, 2013 at 17:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.