I have an IObservable<TouchLocation> and am trying to derive gestures from it.
Was able to pull out Taps but having trouble wrapping my head around Double Tap.
TouchLocation has Position and State so Tap is derived by aggregating these based upon two criteria.
1) Position doesn’t move more than 10px in any direction (allow for some movement but isn’t a drag)
2) Starts on an event with “Pressed” state and continues until one comes in with “Released” state
3) Where the “release” happens within 1 second of the “press”
Now I have an IObservable<List<TouchLocation>> (result of the aggregation) and need to produce the double tap.
How can I return the first gesture (to produce the initial tap) and then substitute the second for a double tap gesture, but only if a second Tap is received before a 1 second timer. If received after the timer then it should also be a simple Tap.
A fun problem.