aboutsummaryrefslogtreecommitdiff
path: root/plugin/leap
diff options
context:
space:
mode:
authorRory Hardy <rory.cronin-hardy@cerner.com>2013-08-05 12:43:07 -0500
committerRory Hardy <rory.cronin-hardy@cerner.com>2013-08-05 12:43:07 -0500
commita06c84e42a0a90dafea063abb6a40419610100a1 (patch)
tree5a2e1ad141d8d1fd2c8a147a76c8ac2023b86cb7 /plugin/leap
parent0e7bc4091ec7a870805f040e342732388db99560 (diff)
downloadfosdem-2018-presentation-a06c84e42a0a90dafea063abb6a40419610100a1.tar
fosdem-2018-presentation-a06c84e42a0a90dafea063abb6a40419610100a1.tar.gz
Removed timing code.
When used correctly, the 1/2 second delay is uncessary and may yield undesireable results. modified: plugin/leap/leap.js
Diffstat (limited to 'plugin/leap')
-rw-r--r--plugin/leap/leap.js17
1 files changed, 2 insertions, 15 deletions
diff --git a/plugin/leap/leap.js b/plugin/leap/leap.js
index ad2e3db..9737529 100644
--- a/plugin/leap/leap.js
+++ b/plugin/leap/leap.js
@@ -22,21 +22,14 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re
(function () {
var controller = new Leap.Controller({enableGestures: true}),
- lastGesture = 0,
config = Reveal.getConfig().leap ||
{
naturalSwipe: true
- },
- now;
+ };
controller.on('frame', function (frame) {
- now = new Date().getTime();
- if( lastGesture === 0 ) {
- lastGesture = now;
- }
-
- if ( (now - lastGesture) > 500 && frame.gestures.length > 0 ) {
+ if ( frame.gestures.length > 0 ) {
var gesture = frame.gestures[0],
x = gesture.direction[0],
y = gesture.direction[1];
@@ -50,8 +43,6 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re
} else {
config.naturalSwipe ? Reveal.right() : Reveal.left();
}
-
- lastGesture = now;
} else {
if ( y > 0 ) {
config.naturalSwipe ? Reveal.down() : Reveal.up();
@@ -59,14 +50,10 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re
config.naturalSwipe ? Reveal.up() : Reveal.down();
}
}
-
- lastGesture = now;
} else if( frame.hands.length == 2 ) {
if ( y > 0 ) {
Reveal.toggleOverview();
}
-
- lastGesture = now;
}
}
}