new Reader(options)reader.jsline 34
To find out it's flick or click or nothing from event datas.
PARAMETERS
Name Type Description options
object
PROPERTIES
Name Type Description type
string
'flick', 'longtab', 'dblclick'
clickTerm
[ number ]
(DoubleClick) Available time distance between first and second click event.
maxDist
[ number ]
(DoubleClick) Available movement distance
flickTime
[ number ]
(Flick) If in this time, do not check move distance
flickRange
[ number ]
(Flick) If not in time, compare move distance with flick ragne.
longTabTerm
[ number ]
(LongTab) Term for checking longtab
minDist
[ number ]
(Flick, LongTab) Minimum distance for check available movement.
usageStatistics
boolean = true
Let us know the hostname. If you don't want to send the hostname, please set to false.
EXAMPLES
var GestureReader = tui.GestureReader; // or require('tui-gesture-reader'); var instance = new GestureReader({ type: 'flick' });
Instance Methods
figure(eventData)flick.jsline 64
Pick event type from eventData
PARAMETERS
Name Type Description eventData
object
Event data
RETURNS:
{object
} - Info of direction and flicking stateEXAMPLES
instance.figure({ list : [{x: 0, y: 0}, {x: 100, y: 100}], start: 0, end: 50 }); => { direction: 'SE', isFlick: false }
getCloseCardinal(first, last, cardinalPoint)flick.jsline 131
Return nearest four cardinal points
PARAMETERS
Name Type Description first
object
Start point
last
object
End point
cardinalPoint
string
CardinalPoint from getCardinalPoints
RETURNS:
{string
}EXAMPLES
instance.getDirection({x: 0, y: 50}, {x: 100, y: 100}); => 'W';
isAvailableZone(pos)doubleClick.jsline 92
Compare with saved position to safe zone
PARAMETERS
Name Type Description pos
object
Position to compare with saved position
RETURNS:
{boolean
} - State of available zoneEXAMPLES
instance.isAvailableZone({ x: 10, y: 10 });
isDoubleClick(pos)doubleClick.jsline 62
Check click or double click
PARAMETERS
Name Type Description pos
object
Distance from mousedown/touchstart to mouseup/touchend
RETURNS:
{}
EXAMPLES
instance.isDoubleClick({ x: 10, y: 10 });
isLongTab(pos, callback)longtab.jsline 72
Stop detect longtab roop.
PARAMETERS
Name Type Description pos
object
A position to end
callback
function
A callback function
RETURNS:
{boolean
} - State of longtabEXAMPLES
instance.isLongTab({ x: 100, y: 150 }, function() { console.log('asdf'); });