views:

194

answers:

4

Hi guys,

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 MICE should work together, at the same time, click or down-move action with different coordinates(x,y).

A: 

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.

ho1
+1  A: 

MusiGenesis: The question is "Is there anything that we could do for implementing VIRTUAL MICE?" :) I know it makes no sense without exact "explanation" but I'm stuck at coding and have headache :|

anyway, I'm not interested in doing the events "fast"... think that you are drawing a line with to virtual mice, if I chose the way of doing the thing fast, there will be "zig-zags" between the coordinates but all I want is having TWO different, INDEPENDENT, virtual MICE...

that's why I interest in if there is a way to multiply the system mouse, I mean, like:

Mouse myMouse1, myMouse2;

and then, using them like:

myMouse1.mouse_event(LEFT_DOWN, x, y);

myMouse2.mouse_event(MOVE, x, y);

there MUST a way to implement at least TWO VIRTUAL MICE, but I dunno how :S

---- UPDATE ---- These mice could be used at the same time. Mouse1 is drawing a flower on the left hand side, and Mouse2 is drawing a circle on the right hand side. But these are all done by code/command, not with a REAL mouse, only mouse_events();

jameshong
A: 

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.

spoulson
A: 

spoulson: actually it could be possible by Microsoft's MultiPoint Mouse SDK, CPNMouse (for XP) and other team software but these are all for REAL HARDWARE, I mean for Mice connected via USB or PS/2. But again, as I haven't tested all of them, they might be work just within some applications, not globally.

anyway, you are right, one logical mouse and there is no way to implement a virtual one for global activity, I think...

jameshong
You should be making your responses in the form of a comment. Additional answers are not always chronologically ordered.
spoulson

related questions