Members
-
LINE_LENGTH
-
Type:
- number
- Default Value:
-
- 150
Properties:
Name Type Description LINE_LENGTHnumber Line length for swipe detection Example
let kotas = new KotasJS({linelength:200}) -
TRESHOLD
-
Type:
- number
- Default Value:
-
- 50
Properties:
Name Type Description TRESHOLDnumber Treshold for swipe detection Example
let kotas = new KotasJS({treshold:100})
Methods
-
on(event, callback)
-
Currently there are only 4 events right now: swipe_down, swipe_up, swipe_left, swipe_right
Parameters:
Name Type Description eventnumber | string Event name callbackfunction Callback function Returns:
Examples
// Listen to all mouse gestures kotas.on("*", (e) => { alert(e.event) })// Listen to Swipe Down event kotas.on("swipe_down", (e) => { alert(e.event) })// Listen to Swipe Up event kotas.on("swipe_up", (e) => { alert(e.event) })// Listen to Swipe Left event kotas.on("swipe_left", (e) => { alert(e.event) })// Listen to Swipe Right event kotas.on("swipe_right", (e) => { alert(e.event) })
Type Definitions
-
ReturnObject
-
Type:
- Object
Properties:
Name Type Description idnumber Event id (0) eventstring Event name (swipe_down) eventshortstring Event short name (down) startXnumber Start X coordinate (370) startYnumber Start Y coordinate (273) endXnumber End X coordinate (400) endYnumber End Y coordinate (231)