Archived

This topic is now archived and is closed to further replies.

adiash

DirectInput: Using 2 mice at the same time

Recommended Posts

Hi. I've got two mice installed on my system (win 2000). One through the USB and the other through the PS2. I wrote a piece of code, using EnumDevices trying to obtain and create a seperate device for each mouse and getting input from them. According to the DXSDK this is possible
quote:
"...For all other input devices, and for systems with multiple keyboards or mouse devices, call IDirectInput8::EnumDevices or IDirectInput8::EnumDevicesBySemantics to enumerate available devices and find one that is suitable. ..."
The problem is that during enumeration I only get a single mouse. DirectInput seems to ignore the fact that there are two of these installed attached and working on my system. Has anyone here ever succeded in doing something like that? Oh, and please only respond if you actually wrote or saw something like that yourself that WORKED. [edited by - adiash on October 7, 2003 10:25:25 AM] [edited by - adiash on October 7, 2003 10:27:13 AM]

Share this post


Link to post
Share on other sites
Ahh I have the same problem.. I have a wireless USB key/mouse (logitech), but I also enumerate only a single device for mouse and a single one for keyb.

Let me ask you this: can use use both at the same time, and it moves the same mouse cursor? For me it does, so I think that windows treats it like a single device.

However if you have multiple mice, and you must choose between them, only then will DX detect multiple devices.

For example, when you have 2 joysticks, you must clearly enable one of them to be default. (is this right?)


www.cppnow.com

Share this post


Link to post
Share on other sites
Windows treats the two mice as the same device, i.e. they both move the same cursor. This is true at least for windows XP and Windows 2K, that I used to check it with.
I am really baffled by this one. The SDK clearly states that you can use multiple input devices (on non XP systems at least), yet I can''t seem to find any way of doing so. Also, notice that if you run dxdiag, in the input tab you will see that there is only one mouse device, so it''s not a programming error.
Like you, I am also lead to believe that this is somehow a configuration, rather than a programming issue. We somehow have to find a way to tell windows to treat the mice independently.
Do you think this might have to do with the fact that the mice use different ports? I noticed that the USB mouse is using a low-level protocol called HID (human interface device), and this is mentioned in several places in the SDK, although not in multiple input context.
I''ll keep on trying, let me know if you find something.
As for the joysticks, I never tried that so I don''t want to mislead you with a guess (but I think you are right )
Cheers

Share this post


Link to post
Share on other sites