Mouse Touch Stylus
Mouse操作:
preview mouse down, StylusDevice:null
mouse down,StylusDevice:null
preview mouse up, StylusDevice:null
mouse up,StylusDevice:null
Stylus操作:
preview StylusDown , StylusDevice:2
StylusDown, StylusDevice:2
preview mouse down, StylusDevice:2
mouse down,StylusDevice:2
preview StylusUp, StylusDevice:2
StylusUp, StylusDevice:2
preview mouse up, StylusDevice:2
mouse up,StylusDevice:2
Touch操作:
preview StylusDown , StylusDevice:4
StylusDown, StylusDevice:4
preview TouchDown , TouchDevice:4
TouchDown , TouchDevice:4
preview mouse down, StylusDevice:4
mouse down,StylusDevice:4
preview StylusUp, StylusDevice:4
StylusUp, StylusDevice:4 preview
TouchUp , TouchDevice ID:4
TouchUp , TouchDevice:4
preview mouse up, StylusDevice:4
mouse up,StylusDevice:4
解读:
1,鼠标Mouse操作不会引发触笔事件或触摸事件。其鼠标事件参数e.StylusDevice==null。
2,触笔Stylus操作先引发触笔事件,然后引发鼠标事件。触笔事件参数e.StylusDevice.Id有整数值,与由其引发的鼠标事件参数e.StylusDevice.ID相同。
3,触摸Touch操作先引发触笔事件,然后引发触摸事件,最后引发鼠标事件。Stylus事件、Mouse事件的e.StylusDevice.ID与Touch事件的e.TouchDevice.ID相同。
4,触摸Touch不可以Capture,所以不能保证TouchUp事件被触发。但TouchUp必然伴随StylueUp。为保证TouchUp被处理,应对Touch引发Stylus进行Capture,处理相应的StylusUp事件。
5,因为4,我们处理Touch操作,除了PreviewTouchDown和TouchDown,应使用Stylus事件。
6,平板电脑手写板手触InkCanvas或自定义墨迹控件,当需要丢弃手指误触形成的墨迹时,可以对墨迹是由笔还是触摸形成的进行判断,判断依据是伴随PreviewStylusDown事件是否出现了PreviewTouchDown,两者时间间隔应很短,且e.StylusDevice.ID=e.TouchDevice.ID。
7,触摸状态,出现笔悬停,自动引发StylusUp事件