4

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 ?

Flemming
  • 694
  • 7
  • 22

2 Answers2

4

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);
gabr
  • 26,580
  • 9
  • 75
  • 141
André
  • 8,920
  • 1
  • 24
  • 24
2

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

André
  • 8,920
  • 1
  • 24
  • 24