Yes, I already know that... but, aren't exactly what I mean. I think this is one difficult, the lack of tutorials on Leap.
Anyway, I find something useful, but I have till some trouble.
I use this code:
Leap.loop(controllerOptions, function(frame) {
// Display Gesture object data
if (frame.gestures.length > 0) {
for (var i = 0; i < frame.gestures.length; i++) {
var gesture = frame.gestures[i];
if(gesture.type == "swipe") {
//Classify swipe as either horizontal or vertical
var isHorizontal = Math.abs(gesture.direction[0]) > Math.abs(gesture.direction[1]);
//Classify as right-left or up-down
if(isHorizontal){
if(gesture.direction[0] > 0){
swipeDirection = "right";
var myleft = Math.round($("#octopus").position().left + 50);
$("#octopus").css({
"left": myleft+"px"
});
} else {
swipeDirection = "left";
var myleft = Math.round($("#octopus").position().left - 50);
$("#octopus").css({
"left": myleft+"px"
});
}
} else { //vertical
if(gesture.direction[1] > 0){
swipeDirection = "up";
var mytop = Math.round($("#octopus").position().top - 10);
$("#octopus").css({
"top": mytop+"px"
});
} else {
swipeDirection = "down";
var mytop = Math.round($("#octopus").position().top + 10);
$("#octopus").css({
"top": mytop+"px"
});
}
}
//console.log(swipeDirection)
$("#display").html(swipeDirection);
}
}
}
});
but it seems to trigg hand move just once