Driver for Joystick Device

Posted on 2003-03-20
Medium Priority
Last Modified: 2013-12-03
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.


Question by:teleplayr
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 11

Expert Comment

ID: 8195586
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.

Author Comment

ID: 8198127
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.
LVL 11

Accepted Solution

robert_marquardt earned 600 total points
ID: 8200342
It should be possible to make the device HID through driver. You will have to place a USB filter driver which creates the HID descriptor on the fly.
This is a job for a driver expert which i am not.
I recomment the drivers newsgroup of Microsoft msnews.microsoft.com microsoft.public.development.device.drivers and the USB IF forum http://www.usb.org/phpbb/viewforum.php?f=1

Author Comment

ID: 8363029
Since you're the only one nice enough to answer, points for ya :)

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question