Disabling and Enabling USB joystick

Hi,

I will be using VB6/VB.net to write a shell for an old flight simulator game (Red Baron 3D).  That shell, among other things, will launch the game when the user has selected various options.  I also want the shell to solve one of the problems that RB3D has when running under XP.

Under XP, the game thinks there is a conflict between the sound card and the joystick.  The game software figures that it is better to fly without sound than without control of the airplane so it disables the sound.

In actuality, there is no conflict.  A work around is for the player to unplug the joystick, start the game, and plug it back in after the program has checked for the conflict.

I want to write code such that when the user selects to launch the game, the program disables the joystick.  It would then wait a specified delay to give the game enough time to start and then it would re-enable the joystick.  Better yet would be to detect when the game has transitioned from the game opening into the full screen DirectX flight mode and then re-enable the joystick thus avoiding the delay business altogether.

It was suggested that I could do this by controlling DirectX with the shell program.  This is completely foreign to me so have no idea how to go about it.

Your help is greatly appreciated.



Answer this question

Disabling and Enabling USB joystick

  • new2dev

    Is the target application a DirectX-based one

    Either way, I can't think of any built-in way to disable hardware like you want - in fact, any method using DirectX to disable hardware for another application is likely to be more of a hack than proper usage of the API Smile

    You really need to know how it's checking for the conflict in order for a work-around. If it's going via the operating system (e.g. regular Win32 calls) then you'll need to try and "intercept" it there.

    Sorry I can't be of more assistance - but to my knowledge, there isn't an easy way to do what you want!

    Jack


  • Disabling and Enabling USB joystick