Famous/famous — pull request #457 by timjchin (2014-11-08 00:31:41+00:00)
Title: updating mousesync and touch sync to update velocity on touch / mouse en...

To solve: https://github.com/Famous/famous/issues/384

This PR updates `MouseSync` & `TouchSync` to calculate the velocity on the end events. Instead of averaging the last 10 (by default) known positions, it will sample the previous known positions until it passes the `timeSampleDuration`, which is time in milliseconds. In testing, about 400 milliseconds seems to be a good value.

Choosing the last known history based on time gives you a much greater chance of having a [0, 0] velocity if the user is holding the mouse completely still, since browsers emit events based on how fast you are moving the mouse.

Also, thank you @dinopetrone for putting together a test to solve this issue, it was very helpful!

@michaelobriena
@dinopetrone