LeapScroll -- Javascript for LeapMotion scrolling Drag this link LeapScroll (javascript) onto your browsers toolbar. Or click for a test run! Features: Using more fingers scrolls faster.

There is a small neutral zone (from 90mm to 125mm above)

The scroll zone is low enough to the device to allow resting your (my) wrist on the table in front of the device

Above 325mm is a zone that scrolls up extra faster

Scrolling should only work when the window (javascript document) "has focus".

Multiple fingers (even across multiple hands) at multiple heights can all contribute to the scrolling rate. If that doesn't work for some reason try creatng a bookmark for this page then edit te bookmark and you can copy+paste the link contents (one line of code) or even the multi-line code below into the "URL" section of the bookmark. Instructions: After loading some web page that you want to scroll through just click the bookmark and you can use your Leap Motion controller to scroll. Note, this requires (and loads) the Leap Javascript library from: http://js.leapmotion.com/ I started with code from here: http://garage-interactive.com/leapbookmarklet/ which is out of date. *** Only tested in Chrome!



Browse, edit, fork, and contribute to the code on GitHub: https://github.com/RudeDude/LeapScroll

You can always copy this code block, change the parameters if you wish and paste it into your bookmark manually. The parameters are currently, 90) the low point where scrolling down beings a.k.a. bottom of the dead-zone, 125) the top of the dead-zone where scrolling-up begins, 325) the bottom of the upper scroll-up-fast zone. The '+=5' and '-=5' are how much scrolling occurs for each finger in a zone. A prettier version of the Javascript in the bookmarklet is here: javascript:(function(){ function runScript(){ var e={}; var t={}; var n=document.body; Leap.loop(function(t){ var r={}; var i={}; for(var s=0, o=t.pointables.length; s!=o; s++){ var u=t.pointables[s]; var a=e[u.id]; var f=n.scrollTop; if(document.hasFocus()){ if(u.tipPosition[1]-325>0){n.scrollTop=f-=150} if(u.tipPosition[1]-125>0){n.scrollTop=f-=5} if(u.tipPosition[1]-90<0){n.scrollTop=f+=5} } } }) } if(typeof Leap=="undefined"){ var jsCode=document.createElement("script"); jsCode.setAttribute("src","https://js.leapmotion.com/0.2.0/leap.min.js"); jsCode.onload=runScript;document.body.appendChild(jsCode) }else{ runScript() } }()); This page is nice and tall for test scrolling. Enjoy!!

