Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mix-and-match inputs from two game controllers into one "virtual" controller?

Image the following situation:

  1. You're on Windows XP (even though the dialog shown below is a Vista screenshot).
  2. You have two physical USB game controllers, let's call them A and B.
  3. You have a piece of software that apparently accesses joysticks in a legacy way, only recognizing and allowing use of one single joystick.
  4. When using this software, you want to use both controllers together, for instance:
    • use the left thumbstick from A and the right thumbstick from B
    • use buttons #1, #2 and #6 from A and buttons #2 and #8 from B

I guess this problem must have already popped up in hardcore gaming somewhere, and a kind of "virtual game controller driver" or other piece of software for this is available. This would ideally show up as a game controller in Windows and allow a virtual setup as described above using any inputs available on physically connected controllers to create a compound virtual one.

Windows Legacy Joystick dialog

If this is the case, I'd love to hear where to get my hands on this. And if not, any pointers on trying to get this going are welcome. I guess I'd have to read up on DirectInput and dust off my next to non-existent C++ skills then?

Like Runeborg answered, it now looks like I might have to get cracking at trying to write my own "virtual game controller device driver" if I want this to happen. :-(

Quick update: have asked same question on smartgamer in the hope another crowd there might come up with an existing answer.

like image 533
peSHIr Avatar asked Nov 05 '22 19:11

peSHIr


1 Answers

If you want to make it generic to all windows applications I would imagine you have to write your own virtual game controller device driver. This gamedev.net thread seems to hold a few clues. It may also be interesting to have a look at Johnny Chung Lee's Wiimote magic or the Wiimote project. Johnny Chung also links to Managed Library for Nintendo's Wiimote.

The Wii projects should contain enough information if you dig a bit to get you going. I can't really think of any other way, other than perhaps plugging in as a middleware between the application and windows somehow by intercepting messages.

like image 97
Runeborg Avatar answered Nov 14 '22 14:11

Runeborg