10

I am trying to make a gesture based PowerPoint slideshow. JavaScript would certainly not work here as I want my slideshow to work when that particular PowerPoint file (.ppt) is opened for windows.

I googled, posted a question on the Leap Motion forum, but in vain. My primary concerns are:

  1. I am unsure about what to use here. Are there some SDKs for this purpose? In simple words, how do I write some custom code for a PowerPoint file on our system? Leap Motion apps can be developed with C#, C++, Python, JavaScript, Java, Objective-C

  2. Integrating the code for Leap Motion device with the above code.

It's OK if you reply with any of the two points. I am sorry I couldn't post any code as I am absolutely new to PowerPoint-based programming for the system itself.

I am open to any language (C, C#, C++, Java, and Objective-C) that lets me accomplish my task. Sugesstions with some information/code would definitely help.

I am a PHP and JavaScript developer. I hope I am clear and not misunderstood.

Update:

I found LEAP Motion Controller Add-ins for Microsoft Office 2010/2013 (C#).

12
  • feel free to correct the tagging if its for good, Aug 28, 2013 at 6:44
  • Hi, it seems that here you can find useful information, source code and/or collaborators.
    – razcor
    Aug 28, 2013 at 7:04
  • @razcor:thx,but is there any thing for mac..and is the tagging correct? Aug 28, 2013 at 7:07
  • @razcor:How can I make the c++,python,java SO folks to see this question,i think i will need more than 5 tags here.. Aug 28, 2013 at 7:17
  • I just retagged your post! I don't know if, at the moment, there are open source projects involving Mac Os X, Leap Motion and MS Office, where you can find information.
    – razcor
    Aug 28, 2013 at 7:23

4 Answers 4

8
+300

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.

6
2

If your aim is just to interact with a PowerPoint presentation then a simple solution might be to use BetterTouchTool.

It's designed for OS X, it works with the Leap Motion Controller, it allows you to map gestures (captured by the LM Controller) to keyboard shortcuts and as long as it's configured correctly, it works whilst it's running in the background.

Essentially, it should be possible to map a swipe with X fingers to the right as a press on the right arrow key - which will advance the presentation to the next slide. And so on.

If, however, you are looking for a programmatic challenge/hoping to make this in to an app for Airspace then you could use something like Apache POI's Java API.

This is a lot more complicated solution, but it does have the benefit that it will run on OS X - and requires you to muck around with some code :).

It seems like the easiest solution would be to follow the example for exporting the slides in to images. You now have a collection of images - one for each PowerPoint slide. This gives you quite a lot of options, such as

  • You can treat this data an an in-memory database (and a web service) and go back to your comfort zone of PHP and JS and use the JS API for the Leap Motion Controller to capture gestures to drive essentially an online picture gallery.
  • You can develop a pure Java solution using the Java API to capture gestures from the Leap Motion Controller and display the data using Swing/JavaFX or in the browser using JSF.
2
  • would this app 'better touch tool' let me control my ppt slides,when they are opened and how that mapping will be done.I request you for a little detailed answer.Do we have a similar app for windows also?have you done leap program integration before.thx Aug 29, 2013 at 4:28
  • 1
    I believe so. I don't own a Mac, so I'm not 100% certain, but a friend of mine has used it with his Leap Motion Controller and found it to to integrate well. It's free, so it's worth downloading it and experimenting with it briefly. Judging by the website it should be possible to set up the mappings to key presses and then have it run in the background. There isn't a port for Windows and it seems that there isn't likely to be one. In my free time I'm experimenting with Leap Motion gesture integration
    – Levity
    Aug 29, 2013 at 9:58
2

A very simple solution could look like this:

  1. Build a basic C# application based on the LeapMotion API (you can use the C# example app from ther SDK). This application must be allowed to run in the background. It connects to the LeapMotion and waits for gestures. It provides a .NET remoting interface (see here for an easy example) and raises an event (see here for an example of events with remoting) for each interesting gesture. When you use the example app, just replace some of the SafeWriteLine(...) with the raising the appropriate event.
  2. Build an office add-in with C# (just use NetOffice, it is free). This add-in starts the background app from step 1, connects with remoting and waits for events.
  3. When the add-in gets an event, it triggers the according actions in PowerPoint (e.g. presentation.GotoSlide(presentation.Slides.Count)).
8
  • hey,thx for the answer but if possible can you add some detailing to your answer?have you build a leap app before? Sep 3, 2013 at 14:39
  • I am part of the developer program. But I have no public available leap motion app (yet). Sep 3, 2013 at 14:55
  • well i am currently learning c#,would this be possible in python also...i mean without any browser..So I dint understood most of the part that are mentioned in the answer..but if i need some help,would you if possible..by mail or chat?is your suggestion and jsonplutext's suggestion the same..he is recommending about VSTO.. Sep 3, 2013 at 15:00
  • For the office plugin you will need DotNET, but you could try IronPython (ironpython.net) with NetOffice. For the LeapMotion part, just look at the python example (developer.leapmotion.com/documentation/Languages/Python/Guides/…). Instead of remoting, your Python program can export a WebService or you can use ZeroMq (zeromq.org). Sep 3, 2013 at 15:10
  • but if I dont want any internet to be used would that be possible on python or c# would be best.. Sep 3, 2013 at 15:13
0

PowerPoint and all office tools supports visual basic .net macros. Simply wrote a vb macro for your ppt file that recognizes the gesture and trigger the page change action. This is enough.

If you want, C# code of leap motion can be integrated in your vb.net macro

3
  • thx for the answer but to be honest,can I get some more detailing about what you are saying? Sep 2, 2013 at 4:54
  • PowerPoint slides can contain Visual Basic code: for example you can execute code in reply to an event (for ex. a click). Sep 2, 2013 at 8:33
  • chat.stackoverflow.com/rooms/36636/… can you join the chat? Sep 2, 2013 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.