I would like to know please, how to prevent WPF promoting mouse events when the source of the event is a touch ?
I read the article of JoshB here but, the mouse events keep getting triggered, although I did e.Handled = true;
Here is what JoshB says:
The touch event flow with no manipulations. The touch events are unhandled, so WPF promotes the event to the mouse equivalent
So, I tried in my code to mark the event as handled, but WPF still promotes mouse events once I touch the _touchSurface
which is InkSurface
Here is my code: ( I am not using Microsoft Surface SDK )
_touchSurface.IsManipulationEnabled = true;
_touchSurface.TouchDown += new EventHandler<TouchEventArgs>(touchDown);
_touchSurface.TouchMove += new EventHandler<TouchEventArgs>(touchMove);
_touchSurface.TouchEnter += new EventHandler<TouchEventArgs>(touchEnter);
_touchSurface.TouchLeave += new EventHandler<TouchEventArgs>(touchLeave);
_touchSurface.ManipulationDelta += new EventHandler<ManipulationDeltaEventArgs>(ManipulationDelta);
_touchSurface.ManipulationStarting += new EventHandler<ManipulationStartingEventArgs>(ManipulationStarting);
_touchSurface.ManipulationCompleted += new EventHandler<ManipulationCompletedEventArgs>(ManipulationCompleted);
void touchDown(object sender, TouchEventArgs e)
{
e.Handled = true;
}
void touchMove(object sender, TouchEventArgs e)
{
e.Handled = true;
}
void touchLeave(object sender, TouchEventArgs e)
{
e.Handled = true;
}
void ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
{
e.Handled = true;
}
void ManipulationStarting(object sender, ManipulationStartingEventArgs e)
{
e.Handled = true;
}
void ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
e.Handled = true;
}