This is an exciting, new piece of technology that has lots of potential. The Leap SDK supports C++, Java, Unity, CSharp, and a few other prominent languages. That's great, but it doesn't support AutoHotkey! The goal of AutoLeap is to do just that.

This is a two-layer module with a small C++ application being the inner layer and AutoHotkey (AutoLeap.ahk) being the outer layer. The inner layer has a callback in a thread from msvcr120.dll. The callback is invoked when a "pointable" object comes into view of the controller. The rate at which the callback is invoked is directly dependent upon your frame rate, meaning that if you get 60 FPS then the callback is called every ~16.67ms (1000 ms / 60 frames). This is important to understand because this means your script should take no longer than 16.67 (or 1000 ms / FrameRate ) to execute it's "OnFrame" events or else lag will occur.

Q: Couldn't the lag be avoided by using a buffer?
A: One day, I hope so. Currently the limitation revolves around the fact that the C++ application uses SendMessage (which waits for a return value before proceeding) to forward data to the AHK script (AutoLeap).

Included in this post is a sample which demonstrates various ways to use this Leap Motion Controller with AutoHotKey. It's important to know the basics, and here they are:

Initialize an AutoLeap object like this: vLeap := new AutoLeap("LeapSample_MsgHandler")

Callback must have the following parameters: LeapSample_MsgHandler(sMsg, ByRef rLeapData, ByRef rasGestures, ByRef rsOutput)

rLeapData is your friend. It is an EasyIni object with sections for all hands and fingers within view of the controller.

Keys explained
[X/Y/Z]: This is the position of the hand or finger relative to the Leap Motion Controller. (0, 0, 0) is the center of the field of view.
Delta[X/Y/Z]: This is the stabilized change in position since the last frame
Delta[X/Y/Z]_US: This is the unstabilized change is position since the last frame
DistToBound: How near/far the hand is to the outer-boundary of the field of view. Leap data becomes less reliable as your hands get closer to the boundary, so this variable can be used as a proxy to ignore unreliable data.
DataType: Can be "Forward" or "Post" sMsg (first parameter in the callback) is actually set to this. It seems silly to effectively include the parameter twice, so eventually I'll remove it. "Post" means that all "pointables" just went out of view, so the controller is no longer tracking data; conversely, "Forward" means pointable(s) are in view and so the controller is tracking and forwarding data. This method of forward/post is vital to AutoLeap because it is how you terminate a gesture chain.
ScaleFactor: Deprecated. It was used as a means to emulate pinching, but it sucked and the newest LeapSDK will natively support pinching.DirectionTouchDistance and TouchZone are helpful tools to establish a virtual touch plane.

Looks like it was no mistake, I see you mentioned it in your credits on the Github project, sorry to bother on that dependency.
I understand how, once you have something in your lib, it's easy to forget that not everyone has it!

Looks like it was no mistake, I see you mentioned it in your credits on the Github project, sorry to bother on that dependency.
I understand how, once you have something in your lib, it's easy to forget that not everyone has it!