在 Mac OS X 中生成鼠标事件
我有一个 USB 设备,可以发送一些专有数据,并且有一个算法可以将其转换为鼠标坐标,我的问题是如何编写一个向 Mac OS X 报告的驱动程序?
我已经看到了一些对 IOHIDPostEvent
的引用,但我在 Apple 的开发者网站上找不到详细的文档。这是正确的方法吗?我正在尝试编写用户空间驱动程序与内核驱动程序。
谢谢
I have an USB device that will send out some proprietary data and I have an algorithm that converts it to mouse coordinates, the question I have is how do I write a driver that reports to Mac OS X?
I have seen some references to IOHIDPostEvent
but I cannot find detailed documentation on Apple's Developer Website. Is this the correct way? I am trying to write an user-space driver versus an in-kernel drive.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在此处检查正在运行但已弃用的程序: http://www.macosxhints.com/ Article.php?story=2008051406323031
CGPostMouseEvent 的新替代品是 CGEventCreateMouseEvent,您可以在此处阅读有关它的更多信息:http://developer.apple.com/mac/library/documentation/Carbon/Reference/QuartzEventServicesRef/Reference /reference.html#//apple_ref/c/func/CGEventCreateMouseEvent
You can check a working but deprecated program here: http://www.macosxhints.com/article.php?story=2008051406323031
The new replacement for CGPostMouseEvent is CGEventCreateMouseEvent and you can read more about it here: http://developer.apple.com/mac/library/documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html#//apple_ref/c/func/CGEventCreateMouseEvent