Last active
December 12, 2015 03:19
-
-
Save fi-tomek-augustyn/4706145 to your computer and use it in GitHub Desktop.
Gesture detection: Identifying global events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add event listeners | |
surface.addEventListener('MSPointerDown', function(event) { | |
// Add pointer to track | |
msGesture.addPointer(event.pointerId); | |
}); | |
// Reset when gesture starts | |
surface.addEventListener('MSGestureStart', resetGesture); | |
// Try to detect when gesture changes | |
surface.addEventListener('MSGestureChange', detectGesture); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment