Class Gesture.LongPress

Long-Press Gesture Recognizer Class.

gestures to recognize long presses, multiple touches and taps.

Inherits from:

Fields

Gesture.LongPress.EVENT Event name constant.
Gesture.LongPress.GESTURE Event type constant, gesture recognized.

Getters and Setters

.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).


Fields

Gesture.LongPress.EVENT
Event name constant.
  • EVENT

Usage:

  • gesture:addEventListener( gesture.EVENT, handler )
  • gesture:removeEventListener( gesture.EVENT, handler )
Gesture.LongPress.GESTURE
Event type constant, gesture recognized. this type of event is sent out when a Gesture Recognizer has recognized the gesture
  • GESTURE

Usage:

     local function handler( event )
     	local gesture = event.target
     	if event.type == gesture.GESTURE then
     		-- we have our event !
     	end
     end

Getters and Setters

.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.

Usage:

  • 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.

Usage:

  • 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

Usage:

  • 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

Usage:

  • print( gesture.touches )
  • gesture.touches = 2
generated by LDoc 1.4.3 Last updated 2015-05-14 11:55:03