directInput using two mouse

Started by
1 comment, last by lomateron 11 years, 2 months ago

I have this:


din->EnumDevices(DI8DEVCLASS_POINTER,DIEnumDevicesCallback,NULL,DIEDFL_ATTACHEDONLY);

and this:


GUID gUID[2];

BOOL CALLBACK DIEnumDevicesCallback(LPCDIDEVICEINSTANCE lpddi,LPVOID pvRef)
{
            if(numMice<2)
            {
                    gUID[numMice]=lpddi->guidInstance;
                    numMice++;
            }
            return DIENUM_CONTINUE;
 }

then I attach two mouses to my computer and it only counts one(The numMice variable goes to 1). WHY?
Inside the app the input of the two mice are combined.
The two mouses work correctly in windows 7 OS.
Advertisement

Going out on a limb here but are you sure it's possible to make distinctions between two mice? I have zero experience with this and may be wrong here but my understanding is that the computer can listen from multiple "mouse" devices but it all get's "lost in translation" if you will. That is to say that when you respond to a "mouse event" you are responding to that event from any mouse or touch pad on the system not so much one or the other. There is a lot of room for me to be wrong here but maybe you don't see two mice because the computer doesn't really have two mice? It has two different input devices that act as a single "mouse" where either of their inputs cause the same events?

** FOLLOW UP EDIT **

Had to find some more on this, yes it appears that DirectX (or Direct Input to me more correct) as of version 9.0 no longer differentiates between multiple mice.

http://social.msdn.microsoft.com/forums/en-US/gametechnologiesgeneral/thread/ee6693bc-7e06-4320-8467-6bed87f2cc68/

and

http://link.mywwwserver.com/~jstookey/arcade/rawmouse/

Dan Mayor

Professional Programmer & Hobbyist Game Developer

Seeking team for indie development opportunities, see my classifieds post

Here is the solution for that

This topic is closed to new replies.

Advertisement