I am working on my own mouse control software on my computer using the C # and kinect SDK. I really want to try using it to play a game like Red Alert, or some kind of RTS, or even just for general navigation.
The problem I discovered is that when using a program with a different mouse, such as a red warning or switching to a virtual machine where integration with the mouse is not supported, the program will not receive calls that the C # program makes calls to System.Windows .Forms.Cursor, not to mention mouse_event calls. I'm new to interacting with windows and what's happening here, can someone explain / present a solution?
- UPDATE-- As an update, I'm still not quite sure what is happening, but I seem to have found a workaround for the red warning, in particular:
Since the red warning is a rather low graphics program, it is trivial to run it in a virtual machine especially for me, a VMware workstation with an XP client. If you use mouse_event code, it works well, VERY, something I struggled with is finding the right code to display mouse movement. It would seem that the MOVE flag moves the mouse relative to what I did not want, and the absolute tag did not move the mouse at all. In fact, the OR of them produces absolute movement on the screen, so my code for mouse movement and click emulation looked like this:
mouse_event((int)0x00000002, cursor.X, cursor.Y, 0, 0);
for click and
mouse_event((int)(0x00000001 | 0x00008000), x, y, 0 0);
for mouse movement, where x and y are the new coordinates from 65535 (absolute range). It's fine? Nope. But now it works. I think something has to do with the way windows ignore certain programs when ra starts, possibly due to compatibility mode? I have no other game to test it right now, but I will publish the results with the incompatibility mode in the future.
(This did not allow me to post the answer for another two hours, and I have to sleep to catch the flight in the morning!)