Identify multiple mouse and trigger events

Hello there,

I'm fairly inexpierent in programing since i work in another IT-field. Maybe you can help me with this problem.


I have between 4-6 usb mices. All are connected to the same PC. I'd like to trigger different events, depending on wich mouse i'm moving.

for example:

mouse 1 is moving trigger event 1
mouse 2 is moving trigger event 2

... and so on.

I've done some research and found some examples using WM_INPUT. Now before i waste to much time, am I on the right track?

Are there some good examples you know of?

It seems like there aren't many people in my situation. Do you recoment a specific way to solve this problem?

Thank you for your time
I've done some research and found some examples using WM_INPUT. Now before i waste to much time, am I on the right track?

It does look that way.

There is this site where they complain about the removal of multiple mice support from DirectX and how they now have to use Raw Input instead.

Multiple Mice in Windows XP using Raw Input
http://www.jstookey.com/arcade/rawmouse/

(in case you haven't already seen this site, it included sample code.)

but this was before Windows 7 was released, which might be able to handle multiple mice via WM_TOUCH and WM_GESTURE. Searching for mutiple mice and WM_TOUCH I found references to people wanting to use a pair of mice to test code for touchscreens on non-touch capable PCs.

And you've also got to contend with the fact that Windows is only geared up to support a single mouse pointer and therefore (usually) merges the input from multiple mice into a single stream of events (WM_LBUTTONDOWN, etc). This means that multiple mice will probably confuse the operation of the system and normal (non-mutliple mice aware) apps. But it does appear that their are third-party drivers available which do support multiple mice, e.g.

MultiMouse 1.0.39
http://www.windows7download.com/win7-multimouse/ztjjgcdq.html

TeamPlayer
http://lifehacker.com/5080196/teamplayer-enables-multiple-input-devices

and this old open source project:

CPNMouse
http://cpnmouse.sourceforge.net/
(link now dead)
http://web.archive.org/web/20120908060728/http://cpnmouse.sourceforge.net/
(archived version)
http://mirror.transact.net.au/pub/sourceforge/c/project/cp/cpnmouse/

which even has its a YouTube.co video:
Using two mouse devices in windows - Very cool
http://www.youtube.com/watch?v=fDcxEILo5gQ

Are there some good examples you know of?

Well, there doesn't seem to be a lot about. But the open source project's code ight be worth a look at for inspiration. And there's also the Raw Input code to look at.

It seems like there aren't many people in my situation.

I guess this need has been limited to games so far, though a computer connected to two monitors might be a cheaper way to allow two kids to surf the web at the same time.

Andy
Topic archived. No new replies allowed.