在OS X中生成和发布Multitouch-Events以使用外部相机控制Mac [英] Generate and post Multitouch-Events in OS X to control the mac using an external camera

查看:141
本文介绍了在OS X中生成和发布Multitouch-Events以使用外部相机控制Mac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为我的大学从事一项研究项目.目标是使用Microsoft Kinect相机控制Mac.另一个学生正在编写Kinect驱动程序(该驱动程序将安装在Mac后面的天花板或墙壁上的某个位置,并在Macs屏幕上输出所有手指的位置).

使用该手指位置并对其做出反应是我的责任.目标是使用一个手指来控制鼠标并以相同的方式对多个手指做出反应,就像它们在触控板上一样.

我认为这将是简单而直接的,但事实并非如此.实际上,使用一个手指(使用CGEvent)控制鼠标光标非常容易,但是不幸的是,没有用于创建Multitouch-Gesture并将其发布到系统的公共API.

我已经做了大量研究,包括使用事件抽头在尽可能低的位置捕获所有CGEvent,并尝试对其进行分解,但到目前为止还没有真正的进展.

比我偶然发现并意识到,即使事件轻拍的最低位置也不够深: 扩展Magic Mouse的功能:我是否需要kext?

当我做对时,内置的触控板(以及MagicMouse和MagicTrackpad)通过KEXT-Kernel-Extension与私有MultitouchSupport框架进行通信,该框架以某种方式生成并将输入的数据发布到操作系统.

因此,我需要使用MultitouchSupport.framework中的私有API来完成与触控板一样的操作,对吗? 还是我需要写一个KEXT-Extension?

如果我需要使用MultitouchSupport框架,请执行以下操作: 我如何反汇编以获得专用API? (我知道类转储,但仅适用于Objective-C框架,而该框架不适用)

非常感谢您的回复! NexD.

解决方案

这里的目标是使用一个手指来控制鼠标并以相同的方式对多个手指做出反应",如果我了解您要执行的操作您是否尝试从Kinect跟踪手指.但问题是Kinect仅捕获主要的身体关节.但是我想您可以使用其他第三方库来实现.这是我看到的一个示例项目.但它的窗户.只需尝试在此处获得大画面Extending Functionality of Magic Mouse: Do I Need a kext?

When I got it right, the built-in Trackpad (and the MagicMouse and the MagicTrackpad) communicates over a KEXT-Kernel-Extension with the private MultitouchSupport-framework, which is generating and posting the incoming data in some way to the OS.

So I would need to use private APIs from the MultitouchSupport.framework to do the very same thing like the Trackpad does, right? Or would I need to write a KEXT-Extension?

And if I need to use the MultitouchSupport-framework: How can I disassemble it to get the private APIs? (I know class-dump, but that only works on Objective-C-frameworks, which this framework is not)

Many thanks for any response! NexD.

解决方案

"The goal is to use one single finger to control the mouse and react on multiple fingers the very same way" here if I understand what you are trying to do is you try to track fingers from Kinect. But the thing is Kinect captures only major body joints. But you can do this with other third party libraries I guess. Here is a sample project I saw. But its for windows. Just try to get the big picture there http://channel9.msdn.com/coding4fun/kinect/Finger-Tracking-with-Kinect-SDK-and-the-Kinect-for-XBox-360-Device

这篇关于在OS X中生成和发布Multitouch-Events以使用外部相机控制Mac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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