By default, only horizontal swipe gestures are detected
(onSwipeLeft and onSwipeRight will work, but onSwipeDown or onSwipeUp won't).
To detect in all directions, add this to your initialization script in Javascript:
hammertime.get('swipe').set({direction: Hammer.DIRECTION_ALL })To detect only vertical swipes, use:
hammertime.get('swipe').set({direction: Hammer.DIRECTION_VERTICAL })To be able to use onRotate, onRotateStart, onRotateEnd and onRotateCancel,
you need to add this line to your Javascript initialization script:
hammertime.get('rotate').set({ enable: true });To be able to use onPinch, onPinchStart, onPinchEnd, onPinchMove etc...
you need to add this line to your Javascript initialization script:
hammertime.get('pinch').set({ enable: true });By default, only horizontal pan gestures are detected
(onPanLeft and onPanRight will work, but onPanDown or onPanUp won't).
To detect in all directions, add this to your initialization script in Javascript:
hammertime.get('pan').set({direction: Hammer.DIRECTION_ALL })To detect only in the vertical direction, use:
hammertime.get('pan').set({direction: Hammer.DIRECTION_VERTICAL })All the functions onTap, onSwipe, onRotate etc... have been defined using
the onHammer function.
You probably don't need to use it directly unless you've defined a custom type event using Hammer.js in Javascript.
An integer representing the direction of the movement. It's a combination of flags (see https://hammerjs.github.io/api/#directions)
You shouldn't need this. The events you receive from onTap, onSwipe etc...
are already decoded into an HammerEvent Elm record.
I let this function public just in case you want to use it to make very custom things.
This function encodes a HammerEvent Elm record back to a Javascript object.
You probably won't need this unless you want to display an event as a Json string in your views.
Record representing an event as emitted by the Hammer.js library.
See https://hammerjs.github.io/api/#event-object for explanation about the fields.