Multiple mouse pointers?

我只是一个虾纸丫 提交于 2020-01-12 04:26:51

问题


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?



来源:https://stackoverflow.com/questions/237155/multiple-mouse-pointers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!