使用跳跃运动为 PowerPoint 编写自定义代码? [英] Writing custom code for PowerPoint using leap motion?

查看:25
本文介绍了使用跳跃运动为 PowerPoint 编写自定义代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作基于手势的 PowerPoint 幻灯片.JavaScript 肯定不会在这里工作,因为我希望我的幻灯片在为 Windows 打开特定的 PowerPoint 文件 (.ppt) 时工作​​.

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.

我用谷歌搜索,在 Leap Motion 论坛上发布了一个问题,但徒劳无功.我的主要担忧是:

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

  1. 我不确定在这里使用什么.是否有一些 SDK 用于此目的?简单来说,我如何为我们系统上的 PowerPoint 文件编写一些自定义代码?Leap Motion 应用程序可以使用 C#、C++、Python、JavaScript、Java、目标-C

Leap Motion 设备 的代码与上述代码集成.

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

回答这两点中的任何一点都可以.很抱歉,我无法发布任何代码,因为我对系统本身的基于 PowerPoint 的编程完全陌生.

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.

我对任何可以让我完成任务的语言(C、C#、C++、Java 和 Objective-C)持开放态度.提供一些信息/代码的建议肯定会有所帮助.

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.

我是 PHPJavaScript 开发人员.希望我说的清楚,没有被误解.

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

更新:

我找到了适用于 Microsoft Office 2010/2013 (C#) 的 LEAP 运动控制器插件.

推荐答案

适用于 Microsoft Office 的 LEAP 运动控制器插件 您发现这可能是将控制器与 Powerpoint 集成的最佳方式.

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.

要开始使用它,您需要 Visual Studio(似乎您需要 2012).Microsoft 有一个关于 Visual Studio 中的 Office 开发的概述页面.

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.

按照配置计算机上的说明进行操作开发办公解决方案页面.

下载Leap SDK for Windows,解压,然后在Visual Studio的GestureLib.NET4.0项目中,添加LeapCSharp.NET4.0 dll的引用

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

对 GestureListener.cs 做一个简单的修复(在第 44 行使用 IsEmpty).

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

之后,您应该能够从 Visual Studio 中运行 LEAP 运动控制器插件.当你这样做时,它会启动 Powerpoint.

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"是您在此处使用的技术的名称,因此,有关更多信息,请使用 Google 'VSTO add-in powerpoint'.

"VSTO" is the name of the technology you are using here, so for more, Google 'VSTO add-in powerpoint'.

来自插件的源代码,看起来你应该在 Powerpoint 的功能区上看到一个按钮,用于启动和停止 Leap.

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.

看看 ThisAddIn.cs,一旦启动(通过按下功能区上的按钮),控制器应该响应左右手势,分别移动到下一张/上一张幻灯片:-

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 支持额外的手势,你可以按照相同的模式做一些事情.

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

这篇关于使用跳跃运动为 PowerPoint 编写自定义代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆