Flemming
Flemming

Reputation: 694

Getting started with Leap Motion

I just got my Leap Motion controller. But i must admit that i dont know how to get the basic initialisation up and running in SmartMS !?

I have included the leapmotionts-1.0.9+8391.js from https://github.com/logotype/LeapMotionTS and added the leap.Core to the uses clause of my project. Sms accepts a initialisation like this :

Controller:=New JController(); 

But i have no idea on how to set up the eventlistener ?

Upvotes: 4

Views: 424

Answers (2)

André
André

Reputation: 9122

I made some more fixes and now it works!

To try a demo, download the www folder and open index.html: https://github.com/andremussche/AndrewsDelphiStuff/blob/master/Smart/LeapMotion/www/index.html

Upvotes: 2

André
André

Reputation: 9122

I fixed the generated library and re-generated the javascript too (so it works in browsers too) https://github.com/andremussche/AndrewsDelphiStuff/tree/master/Smart/LeapMotion

Example code:

uses
  leap.core;

{$R 'leapmotionts-1.0.9+8391.js'}

  var j = new JController;
  j.addEventListener(JLeapEvent.LEAPMOTION_CONNECTED,
    procedure(event: JLeapEvent)
    begin
      do something
    end);

Upvotes: 4

Related Questions