I'm writing a joy pad emulator for my tablet for fun and for a challenge. I can touch buttons drawn on my form and have keypresses activate in another form. The problem is that many games (I'm testing on minecraft) use mouse offset to let the player look around the world. My problem is that when I touch a button, the mouse moves there and the player in the game looks around wildly.
How can I accept touch input in C# using WPF without moving the mouse?
A method used to gather relative mouse movement sometimes is to read the cursor position, and then reset its position to the centre of the screen, thus giving you the relative moment. This method can be modified to fit your needs.
I found this on how to import function to change the cursor position: http://social.msdn.microsoft.com/forums/en-US/wpf/thread/6be8299a-9616-43f4-a72f-799da1193889/
Essentially, what you do is whenever a button is pressed, you call the method to reset the cursor position to the centre of your target window, this should happen fast enough that the target application shouldn't notice at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With