Use the GestureLayer to detect gestures. The advantage is that you don’t have to implement gesture detection, just set callbacks for gesture states.
In order to use Gesture Layer you start with instantiating this class
with a parent object parameter. Next ‘activate’ gesture layer with a
attach() call. Usually with same object as target (2nd
parameter).
Now you need to tell gesture layer what gestures you follow. This is done with
cb_set() call. By setting the callback you actually
saying to gesture layer: I would like to know when the gesture
Gesture types switches to state Gesture states.
Next, you need to implement the actual action that follows the input in your callback.
Note that if you like to stop being reported about a gesture, just set
all callbacks referring this gesture to None. (again with
cb_set())
The information reported by gesture layer to your callback is depending on Gesture types:
GestureTapsInfo is the info reported for tap gestures:
GestureMomentumInfo is info reported for momentum gestures:
GestureLineInfo is the info reported for line gestures
(this also contains GestureMomentumInfo internal structure):
Note that we consider a flick as a line-gesture that should be completed
in flick-time-limit as defined in
Configuration.
GestureZoomInfo is the info reported for ELM_GESTURE_ZOOM
gesture.
GestureRotateInfo is the info reported for
ELM_GESTURE_ROTATE gesture.
Gesture Layer Tweaks:
Note that line, flick, gestures can start without the need to remove fingers from surface. When user fingers rests on same-spot gesture is ended and starts again when fingers moved.
Setting glayer_continues_enable to false in
Configuration will change this
behavior so gesture starts when user touches (a DOWN event)
touch-surface and ends when no fingers touches surface (a UP event).
Gesture not started
Gesture started
Gesture is ongoing
Gesture completed
Ongoing gesture was aborted
N fingers single taps
N fingers single long-taps
N fingers double-single taps
N fingers triple-single taps
Reports momentum in the direction of move
N fingers line gesture
N fingers flick gesture
Zoom
Rotate