To calculate velocity, keep an array of all move events then use the oldest one up to 150ms old to calculate velocity. This prevents stop-then-release from having momentum.