jaytwo / WmTouchDevice

Raise WPF touch events using WM_TOUCH instead of the lag-prone default implementation.
25 stars 11 forks source link

Manipultation events #2

Open DdarkSideE opened 7 years ago

DdarkSideE commented 7 years ago

Hello! In this project I can see implementation of touch down, touch move and touch up events. I want to use WmTouchDevice for manipulation events, because need to recognize gestures such like translate, scale and rotate. Any ideas how to implement it? TouchDevice has OnManipulationEnded and OnManipulationStarted methods. Is it possible to make magic and gestures become working automaticly using touch events? Or does it need special implementation? Thank you!

DdarkSideE commented 7 years ago

Sorry for this question. All work fine.

jaytwo commented 7 years ago

Good question - I think Manipulation events are automatically generated by WPF at a higher level and so don't require extra support.

DdarkSideE commented 7 years ago

It is very interesnting behavior: Try my version of sample. It is the same sample, but added ManipulationDelta event. Try this:

  1. TouchMove and ManipulationDelta add ellipse. You can see that black ellipse contains red ellipse. It means that both events fired.
  2. Comment line 83 (add black ellipse). What do I want to see? Red ellipses and ManipulationDelta is fine. What I realy saw: standatd wpf touch lags. ManipulationDelta fires bad!
  3. Comment line 99 (add red ellipse). TouchDown works fine all time.
  4. In step 1, I thought all works fine, but it is not. After drawing ellipses in long time, both (TouchMove and ManipulationDelta) start lags like default wpf touch.

I do not understand why it can happends. Why adding ellipse to canvas forces manipulation events? What is that?