Last active
August 29, 2015 13:56
-
-
Save gorhgorh/8916319 to your computer and use it in GitHub Desktop.
Modernizr test for leap motion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkLeap () { | |
// Hard dependency on websockets; quick exit if not supported | |
if (!Modernizr.websockets) { | |
Modernizr.addTest('leap', false); | |
} | |
// Try and connect to the leap daemon | |
var ws = new WebSocket("ws://localhost:6437/"); | |
ws.onopen = function(event) { | |
Modernizr.addTest('leap', true); | |
}; | |
ws.onerror = function(event) { | |
Modernizr.addTest('leap', false); | |
}; | |
} | |
checkLeap(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ahh ok, i'm using the plain development version right now, planned on making a modular build later, i guess it is not included in it.
thanks for this wondefull tool by the way :)