I have developed a C# app that overrides the PreviewMouseUp, PreviewMouseMove, and PreviewMouseDown events in some custom controls to allow scrolling a scroll viewer by clicking and dragging. This custom code works great on non-touch screens when the mouse is used to drag and scroll, but when I use it on a real touch screen monitor it fails to work because the PreviewMouseUp does not get fired when the monitor is touched and dragged with a finger.
I want to be able to use my existing code with minimal changes. This would allow me to use the mouse to click/drag while debugging on my laptop, and use the touch screen to touch/drag.
Is there anyway to configure a windows 7 computer to treat all touches (PreviewTouchUp, PreviewTouchDown, and PreviewTouchMove) as mouse events instead?
UPDATE: I forgot to mention. I thought that if the Touch events are not handled, than .NET automatically raises the Mouse events afterwards. This does not appear to be happening even though none of the code I wrote handles the Touch Events currently. Any ideas why this may be happening?
Thanks,
brian
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…