开发者

Virtual Mice in C#

Is there anything that we could do for implementing VIRTUAL MICE? I mean, I want to have multiple mice within the whole OS, but they must be all VIRTUAL (I'm not talking about the applications that serve multiple mice driver for PS/2 or USB mice or Microsoft's MultiPoint Mouse SDK.)

It is like creating two objects:

Mouse mouse1, mouse2;

and using them like:

mouse1.mouse_event(...); mouse2.mouse_event(...);

having a CURSOR on the screen is NOT IMPORTANT. I only need the action (MOUSE DOWN, MOVE, UP for each but separated)

and the important thing is that these VIRTUAL MI开发者_如何学CCE should work together, at the same time, click or down-move action with different coordinates(x,y).


I don't know how to do exactly what you want, but you can simulate mouse clicks, and if you simulate them fast enough after each other in the different coordinates they will almost be clicked at the same time.

This link shows how to do this:

http://msdn.microsoft.com/en-us/library/ms171548.aspx

If you build that functionality into your own Mouse class it might be similar to what you want to achieve.


AFAIK, you're on your own with this. I think you're on the same idea I had where it would be nice to literally work in pairs with someone on the same computer. Each person having their own mouse and keyboard and looking at the same monitor(s) while working sometimes independently, sometimes together.

My assumption is that this would run into two important restrictions in the design of the Windows OS:

1) It only knows of one logical mouse and one logical keyboard. Plugging in multiple devices simply join forces to move the same logical mouse and type in the same text box.

2) The HID drivers needs to understand multiple "users" by displaying multiple logical mouse pointers and same number of window focus.

I think these can probably be overcome at the driver level with a compatibility layer. Applications and its controls probably wouldn't need to care how many mice or keyboards or "users" are attached to the OS. It simply receives window messages that indicate when it gets focus, when the mouse moves, keys pressed, etc.

Just my $0.02.


the windows ddk(driver development kit) lets you create said amount of virtual mouse devices and send input using the dsf(driver simulation framework). I had a very similar objective except globally because i want to affect mousemischief which i cant using only windows apis by themselves. look at the generichid vbscript and edit it and look at it comments and its pretty straight forward to understand the majority of its code.

I have created the answer to your question because i needed to emulate multiple people kinect device recoginizes as mice indiviually for my kinectmultipoint project: http://kinectmultipoint.codeplex.com. Anyone wanting to convert to vb.net please help as i can use the vbscript but it is unstable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜