wpftouchtablet-pc

StylusDown event comes after TouchDown


I'm developing an application for a tablet with Windows 8. I'm subscribing for both TouchDown and StylusDown events. The problem is - when I make a touch with my finger, both events occur. TouchDown comes first, then comes StylusDown. When I make a touch with a stylus, only StylusDown occurs.

Is it a normal behavior for all the tablets? Or is it specific for some models?

I can't find any documents about this.


Solution

  • This is the standard flow for all touch events in WPF. If the TouchDown event is not marked as handled, it will fire as a StylusDown then as a MouseDown. You can stop this by handling the event, for example below:

    protected override void OnTouchDown( TouchEventArgs e )
    {
        // your code here
        e.Handled = true;
    }