Multiple mouse pointers?

2019-03-24 11:23发布

问题:

Is there a way to accept input from more than one mouse separately? I'm interested in making a multi-user application and I thought it would be great if I could have 2 or more users holding wireless mice each interacting with the app individually with a separate mouse arrow.

Is this something I should try to farm out to some other application/driver/os_magic? or is there a library I can use to accomplish this? Language isn't a HUGE deal, but C, C++, and Python are preferrable.

Thanks :)

edit:

Found this multi-pointer toolkit for linux (it's actually a multi-pointer x server): http://wearables.unisa.edu.au/mpx/

回答1:

You could try the Microsoft Windows MultiPoint Software Development Kit 1.1

or the new Microsoft Windows MultiPoint Software Development Kit 1.5

and the main Microsoft Multipoint site



回答2:

Yes. I know of at least one program that does this, KidPad. I think it's written in Java and was developed by Juan Pablo Hourcade, now at the University of Iowa. You'd have to ask him how it was implemented.



回答3:

http://code.google.com/p/pymultimouse/ is a library using windows raw input, it worked in a test with 2 mice.



回答4:

You could use DirectInput with C/C++ (there's probably also bindings in other languages). You use IDirectInput8::EnumDevices() (using DX8; same function, different interface in other versions of DirectX) to get a list of all attached devices. Then, you create the devices and poll them IDirectInputDevice8::Poll(). This should almost definitely work with any number of mice, keyboards, and other input devices. MSDN has really good documentation on this.



回答5:

I have this vague feeling that BeOS used to let one pair a mouse and keyboard and have separate active windows and inputs. Wow... that was a long time ago. I thought that it would be very interesting for "paired" programming.



回答6:

See my answer here (avoid the JNI stuff): How can I handle multiple mouse inputs in Java?