code-dot-org/blockly — pull request #655 by cpirich (2014-06-10 21:23:01+00:00)
Title: [finishes #70374808]: add hammer.js 1.1.3, use for drag gestures in bounce & flappy

hammer.js 1.1.3 provides a small cross-platform JS library (3KB minified) for multi-touch gestures: https://github.com/EightMedia/hammer.js/

I'm now using this for bounce and studio so you can swipe on the playspace and it will generate the equivalent "key" events.

The "drag" event is being used for now (handles small gestures better than the "swipe" event). The direction for each drag is only left/right/up/down for now (I'm not trying to support diagonal swipes). The distance parameter in each event is translated into a number of movements - the bigger the swipe, the larger the number of successive "key" events that will be fired.

The hammer.js file is added under src and is built/minified using our blockly-apps build process. I added it as an exception to 'jshint' list since it has jshint errors and it seems simpler to use this file unmodified (so we can pick up future changes as needed).