Long-Press Gesture Recognizer Class.
gestures to recognize long presses, multiple touches and taps.
|Gesture.LongPress.EVENT||Event name constant.|
|Gesture.LongPress.GESTURE||Event type constant, gesture recognized.|
|.accuracy ()||the maximum finger-movement allowed (number).|
|.duration ()||the minimum time required for recognition (number).|
|.taps ()||the minimum number of taps for recognition (number).|
|.touches ()||the minimum number of touches for recognition (number).|
Event name constant.
gesture:addEventListener( gesture.EVENT, handler )
gesture:removeEventListener( gesture.EVENT, handler )
Event type constant, gesture recognized.
this type of event is sent out when a Gesture Recognizer has recognized the gesture
local function handler( event ) local gesture = event.target if event.type == gesture.GESTURE then -- we have our event ! end end
- .accuracy ()
the maximum finger-movement allowed (number).
the limit of movement for a gesture to be recognized, radius in pixels.
value must be greater than zero. default is 10.
print( gesture.accuracy )
gesture.accuracy = 10
- .duration ()
the minimum time required for recognition (number).
this is the minimum period that a press must be held for the gesture to be recognized. time is in milliseconds. default is 500ms.
print( gesture.duration )
gesture.duration = 400
- .taps ()
the minimum number of taps for recognition (number).
this specifies the minimum number of taps required to succeed. the long-press is after the number of taps. default is zero (0).
value >= 0
print( gesture.taps )
gesture.taps = 2
- .touches ()
the minimum number of touches for recognition (number).
this is used to specify the number of fingers required for each tap, eg a two-fingered single-tap, three-fingered double-tap.
greater than 0, less than 6
print( gesture.touches )
gesture.touches = 2