How to avoid mouse move on Touch

Posted by VirtualBlackFox on Stack Overflow See other posts from Stack Overflow or by VirtualBlackFox
Published on 2011-11-04T13:44:31Z Indexed on 2012/11/30 17:04 UTC
Read the original article Hit count: 174

Filed under:
|
|

I have a WPF application that is capable of being used both with a mouse and using Touch. I disable all windows "enhancements" to just have touch events :

Stylus.IsPressAndHoldEnabled="False"
Stylus.IsTapFeedbackEnabled="False"
Stylus.IsTouchFeedbackEnabled="False"
Stylus.IsFlicksEnabled="False"

The result is that a click behave like I want except on two points :

  • The small "touch" cursor (little white star) appears where clicked an when dragging.
    Completely useless as the user finger is already at this location no feedback is required (Except my element potentially changing color if actionable).
  • Elements stay in the "Hover" state after the movement / Click ends.

Both are the consequences of the fact that while windows transmit correctly touch events, he still move the mouse to the last main-touch-event.

I don't want windows to move the mouse at all when I use touch inside my application. Is there a way to completely avoid that?

Notes:

  • Handling touch events change nothing to this.
  • Using SetCursorPos to move the mouse away make the cursor blink and isn't really user-friendly.
  • Disabling the touch panel to act as an input device completely disable all events (And I also prefer an application-local solution, not system wide).
  • I don't care if the solution involve COM/PInvoke or is provided in C/C++ i'll translate.
  • If it is necessary to patch/hook some windows dlls so be it, the software will run on a dedicated device anyway.
  • I'm investigating the surface SDK but I doubt that it'll show any solution. As a surface is a pure-touch device there is no risk of bad interaction with the mouse.

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf