Skip to content

phiskus/leapjs

 
 

Repository files navigation

LeapJS Logo

Welcome to the Leap Motion JavaScript framework.

Build Status

Leap.loop(function(frame){
  console.log(frame.hands.length);
});

Learn more in the Getting Started Guide, and the API Reference.

Installation

Browser: Download the latest leap.js from our CDN.

Bower: bower install leapjs

Node: npm install leapjs

Examples

Live Examples can be found at developer.leapmotion.com/leapjs/examples.

Some examples have been included in the examples/ directory. To run them do the following:

  1. Run npm install
  2. Run make serve
  3. Point your browser to localhost:8080/examples

Or in code:

  1. Run node examples/node.js

Plugins

Plugins are used to modularly extend Leap Webapps with external libraries.

Leap.loop(function(frame){
  if (frame.hands.length < 1) return;

  console.log(frame.hands[0].screenPosition());
}).use('screenPosition');

Compatibility

Version 0.3.0 or greater of leapjs requires version 1.0.9 or greater of the tracking software which is available at https://www.leapmotion.com/setup in order to have background support work properly. Mixing and matching prior versions will result in inconsistent background/focus support.

Troubleshooting

You may encounter a problem with an error message including SELF_SIGNED_CERT_IN_CHAIN. This is often a result of changes in OSX's security system; try reinstalling Node.js.

If that does not work, turn off SSL checking with the following instructions:

npm config set strict-ssl=false
npm install leapjs -v0.4.1

Protocol

Details about the protocol used to communicate with leapd are detailed here PROTOCOL.md.

Contributing

Add your name, email, and github account to the CONTRIBUTORS.txt list, thereby agreeing to the terms and conditions of the Contributor License Agreement.

Open a Pull Request. If your information is not in the CONTRIBUTORS file, your pull request will not be reviewed. githalytics.com alpha

About

JavaScript client for the Leap Motion Controller

Resources

License

Stars

Watchers

Forks

Packages

No packages published