This may be of interest: https://github.com/EightMedia/hammer.js/blob/master/src/gestures.js#L115