Skip to content

Instantly share code, notes, and snippets.

@gorhgorh
Last active August 29, 2015 13:56
Show Gist options
  • Save gorhgorh/8916319 to your computer and use it in GitHub Desktop.
Save gorhgorh/8916319 to your computer and use it in GitHub Desktop.
Modernizr test for leap motion
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();
@gorhgorh
Copy link
Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment