Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloning and modifying mouse/stylus events without hijacking the cursor in C#?

Tags:

c#

I've tried to put this into words but I figured an image would be easier to understand. Let us imagine that the white background is the desktop. The first black circle is one application window, the second belongs to another application. Let's call the first one DEST and the second SOURCE. The red circle is the actual mouse pointer while the blue is the simulated one. Now for the questions:

1) How do I dispatch simulated mouse AND stylus events (example: actual cursor moves left while the simulated cursor (blue) moves in the opposite direction) ? Is there some class like Java's Robot for dispatching both mouse AND stylus events or will I have to go through wintab.dll for that?

2) How do I do this WITHOUT hijacking the actual cursor (multiple mouse input devices!?) ?

enter image description here

like image 598
Mark Twine Avatar asked Oct 07 '11 08:10

Mark Twine


1 Answers

I'd think that you could P/Invoke SendMessage to send a WM_MOUSEMOVE or WM_LBUTTONDOWN to the DEST window, it's getting it in the right place that's more difficult. Following might help:

http://michaelsync.net/2006/07/04/sendmessage-c
http://www.codeguru.com/forum/showthread.php?t=337002

like image 52
blaaaaaaah Avatar answered Oct 23 '22 04:10

blaaaaaaah