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).
efl.elementary.
ELM_GESTURE_STATE_UNDEFINED
¶Gesture not started
efl.elementary.
ELM_GESTURE_STATE_START
¶Gesture started
efl.elementary.
ELM_GESTURE_STATE_MOVE
¶Gesture is ongoing
efl.elementary.
ELM_GESTURE_STATE_END
¶Gesture completed
efl.elementary.
ELM_GESTURE_STATE_ABORT
¶Ongoing gesture was aborted
efl.elementary.
ELM_GESTURE_N_TAPS
¶N fingers single taps
efl.elementary.
ELM_GESTURE_N_LONG_TAPS
¶N fingers single long-taps
efl.elementary.
ELM_GESTURE_N_DOUBLE_TAPS
¶N fingers double-single taps
efl.elementary.
ELM_GESTURE_N_TRIPLE_TAPS
¶N fingers triple-single taps
efl.elementary.
ELM_GESTURE_MOMENTUM
¶Reports momentum in the direction of move
efl.elementary.
ELM_GESTURE_N_LINES
¶N fingers line gesture
efl.elementary.
ELM_GESTURE_N_FLICKS
¶N fingers flick gesture
efl.elementary.
ELM_GESTURE_ZOOM
¶Zoom
efl.elementary.
ELM_GESTURE_ROTATE
¶Rotate