So, I'm trying to simulate a left mouse click and a left mouse button to do auto drag and drop.
It is currently located in C # Winforms (Yes, winforms: |) and is a bit scary.
Basically, after sending the click, I want it to update the cursor position based on Kinect input. The Kinect side of things is fine, but I'm not sure how to find if the button is still pressed or not.
here is the code I'm using now + some psuedocode to better explain myself (do it now).
class MouseImpersonator { [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] private static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo); private const int leftDown = 0x02; private const int leftUp = 0x04; public static void Grab(int xPos, int yPos) { Cursor.Position = new Point(xPos + 25, yPos + 25); mouse_event(leftDown, (uint) xPos, (uint) yPos, 0, 0);
I had a google hunt and I canβt find anything I need but the WPF equivalent: http://msdn.microsoft.com/en-us/library/system.windows.input.mouse.aspx
I'm a little out of my depth, but any help is much appreciated.
Lucas.
Lucas source share