Device::Leap - Perl interface to the Leap Motion Controller
use Device::Leap; while(1) { $d=&Leap(); next unless(ref $d); # no new data print $d->{hands}->[0]->{sphereRadius} . "\n"; # print some }
This module provides an interface to query a Leap Motion controller. The controller exposes rapid and accurate hand motion data over a localhost websocket. This script uses native non-blocking sockets to return that data, thus should be compatible on Windows, Mac, and Linux machines without needing compilers or related SDK overhead.
The Leap Motion controller senses your individual hand and finger movements so you can interact directly with your computer.
Leap # one sub which returns you your data
This module requires these other modules and libraries:
Socket (already part of perl itself) JSON
See the Leap Motion web site: https://leapmotion.com/ for links to the developer forums etc.
Chris Drake, <cdrake@cpan.org>
Copyright (C) 2013 by Chris Drake
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
This code impliments WebSockets inline, because existing CPAN ws modules all have heavy overhead requirments needing compilers and development build infrastruture delployed at the client. This was considered both unnecessary and overly limiting. If the Leap Motion websocket spec changes in future and breaks this module, a new CPAN release (update) will be made available.
1 POD Error
The following errors were encountered while parsing the POD:
Unknown directive: =HEAD2
To install Device::Leap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Leap
CPAN shell
perl -MCPAN -e shell install Device::Leap
For more information on module installation, please visit the detailed CPAN module installation guide.