Writing custom code for PowerPoint using leap motion?

The LEAP Motion Controller Add-ins for Microsoft Office which you found is likely to be the best way to integrate the controller with Powerpoint.

To get started with it, you’ll need Visual Studio (seems like you’ll need 2012). Microsoft has an overview page for Office Development in Visual Studio.

Follow the instructions on the Configuring a Computer to Develop Office Solutions page.

Download the Leap SDK for Windows, and unzip it, then in Visual Studio in the project GestureLib.NET4.0, add a reference to the LeapCSharp.NET4.0 dll

Make a trivial fix to GestureListener.cs (use IsEmpty at line 44).

After that you ought to be able to run the LEAP Motion Controller Add-in from within Visual Studio. It’ll start Powerpoint when you do that.

“VSTO” is the name of the technology you are using here, so for more, Google ‘VSTO add-in powerpoint’.

From the source code for the Add-In, it looks like you should see a single button on the ribbon in Powerpoint, for starting and stopping Leap.

Looking at ThisAddIn.cs, once started (by pressing the button on the ribbon), the controller ought to respond to left and right gestures, by moving to next/previous slides respectively:-

                if (direction.ToString() == "Right")
            {
                Application.ActivePresentation.SlideShowWindow.View.Next();
                LastGesture = DateTime.Now;
            }
            if (direction.ToString() == "Left")
            {
                Application.ActivePresentation.SlideShowWindow.View.Previous();
                LastGesture = DateTime.Now;
            }

GestureLib supports additional gestures, which you could make do something following that same pattern.

Leave a Comment