Link to home
Start Free TrialLog in
Avatar of teleplayr
teleplayr

asked on

Driver for Joystick Device

I have a piece of hardware (a joystick) that connects to the PC through the USB port.  There is a dll interface that talks to the joystick.  

When I plug the device in, the drivers install, and I am able to communicate with the device using the interfaces in the dlls (eg, WriteDevice(), ReadDevice(), etc).  This works fine.

My problem is, I want the device to be installed in the Game Controllers section of the Control Panel.  In other words, I don't want to have to write special code to use this joystick, I want to use it like any other joystick device.  

I assume I will have to write a driver layer to go between Windows and the dlls I'm using now to talk to the device.

I have bought "Programming the Microsoft WDM" and have searched everywhere on the net, but cannot find any information on how I should go about this.  The 2000 DDK comes with source code for HID devices, but this device is not HID compliant.

So, if anyone could provide me some direction, that would be great, eg what steps do I need to take?  Source code examples would be even better.

Just so you know your audience:  I know Win32 API programming very well, and am experienced with MASM32 assembly programming, but have never coded anything at the kernel level before, so I'm not even sure what direction to go in with a problem like this.

Thanks,

-Joe
Avatar of robert_marquardt
robert_marquardt

I would expect that an USB joystick identifies itself as a HID joystick from its firmware. Windows can handle such devices with its HID class drivers.
It may be that the drivers which you installed manipulate the identification of the device so it is not identified anymore as a HID joystick.

Try uninstalling the driver assignment by deleting the device while plugged in through the device manager.
After that the device is handled as if it has never been plugged to your computer.
Now find the INF file for your device and delete it because on next plug it would reinstall the drivers. do not forget to delete the PNF file also.

Plug the joystick and let Windows install its standard drivers.
Now have a look if it shows up in game controllers.

Access to a HID joystick is possible through the standard HID API, but Direct Input will read it also and will get a copy of the data.
I suspect that is the reason for hiding the device from the Game Controllers.
Avatar of teleplayr

ASKER

robert:  Thanks, but as I wrote in my first post, the device is NOT HID compliant.  I have contacted the manufacturer of the chip I am using, and there is no way to change the HID descriptor to make it detect as an HID device.  Which is why I want to write this driver to install it into the control panel.

So, I know why it is not getting installed into the control panel.  I want to write a driver to put it there.  I know it can be done, because my MS Sidewinder gameport joystick is not a HID device and it shows up there.
ASKER CERTIFIED SOLUTION
Avatar of robert_marquardt
robert_marquardt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Since you're the only one nice enough to answer, points for ya :)