如何在objective-c中模拟用户输入?

发布于 2024-10-14 19:31:48 字数 264 浏览 12 评论 0原文

在 Windows 上,使用 C#,我能够捕获另一个窗口的“屏幕”,使用它进行处理,然后将用户输入事件发送到该窗口。 (由程序生成)。

我想在 Mac OS X 中对 Objective-C 做同样的事情。所以!任何资源,甚至是我想做的事情的名称都会很棒。当我能想到的表达我的搜索的唯一方法过于模糊时,试图找到这方面的信息是非常令人沮丧的。

谢谢!

编辑:作为一个具体的例子,我可能想为一款特定的游戏制作人工智能。在这种情况下,我需要能够将鼠标和键盘事件发送到游戏。

On windows, and with c#, I was able to capture another window's "screen", use that for processing, and then send user input events to that window. (which were generated by the program).

I would like to do the same with objective-c and within Mac OS X. So! Any resources or even a name for what I'm trying to do would be great. It's very frustrating to try and find information on this when the only ways i can think to phrase my searches are too ambiguous.

Thanks!

EDIT: As a specific example, there might be a particular game that I want to make an AI for. In that case I would need to be able to send mouse and keyboard events to the game.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

緦唸λ蓇 2024-10-21 19:31:48

如果您希望进行自动化用户界面测试,请查看 SquisheggPlant期望OS X 辅助功能。如果您希望以编程方式控制另一个程序,请使用 脚本(如果您编写了要控制的程序,请添加脚本支持;否则,请查看该程序提供的脚本支持),或尝试 Automator

If you're looking to do automated user interface testing, look at Squish, eggPlant, expect and OS X Accessibility. If you're looking to programmatically control another program, use scripting (if you wrote the program to control, add scripting support; otherwise, see what scripting support the program offers), or try Automator.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文