Jump to content
  • Advertisement
Sign in to follow this  
Calin

DirectInput: using two mouses at the same time?

This topic is 4843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would like to ask if someone succeeded in using two mouses with DirectInput. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Check out IDirectInput8::EnumDevices() - if you specify DI8DEVCLASS_POINTER, and you have more than one mouse, it will enumerate multiple pointer devices. At that point, you can easily create the devices from the info given to you inside the callback.

Edit: actually, it looks like you can't do it. From the SDK:

Quote:

On Microsoft Windows XP, Microsoft DirectInput enumerates only one mouse and one keyboard device, referred to as the system mouse and the system keyboard. These devices represent the combined output of all mice and keyboards respectively on a system. For information about how to read from multiple mice or keyboards individually on Windows XP, see the WM_INPUT documentation.


I checked the WM_INPUT msg docs, and it doesn't look like there is too much there, either.

Share this post


Link to post
Share on other sites
I made some google research. It appears that by using "raw input" or CPNMouse you might isolate the input coming from two or several mice.

Share this post


Link to post
Share on other sites
Quote:
Original post by Calin
I made some google research. It appears that by using "raw input" or CPNMouse you might isolate the input coming from two or several mice.

Nice...if you figure it out, could you give us a heads-up? It would make for some interesting gameplay if you could use 2 mice to control your character. Perhaps it would be like the PS2 dual-shock controller, but with the absolute precision of a mouse.

Share this post


Link to post
Share on other sites
Actually I was thinking to use that in a Real Time Strategy game. My thought was to use one mouse for camera rotation on Y,X axes and the other for moving horizontaly across the map. Unfortunately trying to make use of raw input/CPNMouse means to much work for me now. I think I will use the keyboard for moving camera on X,Z plane.
If I will have some spare time I may give it a try though.

Share this post


Link to post
Share on other sites
This is very interesting. I had the same idea of using two mouses at a time, but it was just a draft in my head, nothing particular.
I looked into WM_INPUT on msdn, and it seems there is a way to get input from different mouses.
Well, anyway,
if anyone succeds please let us know by posting here and telling how you did it :)

Share this post


Link to post
Share on other sites
It seems the only way is to use something like CPNMouse, which you have to install as a device driver first. That's nasty.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!