将输入发送到直接输入(如游戏)

发布于 2024-08-17 20:04:10 字数 374 浏览 4 评论 0原文

我正在尝试模拟使用直接输入的游戏的按键。

我用谷歌搜索了一下,找到了 SendInput() 方法。

如果我尝试将按键发送到 notepad.exe,它工作正常,但当我尝试玩游戏时没有任何反应。 我检查了网站,我稍微编辑了代码,但仍然没有从游戏中得到任何按键事件。

有人可以帮我解决这个问题吗?

我使用Python,但由于我导入了ctypes模块,c/c++解释还可以。

I'm trying to simulate keypress to my games that use direct input.

I googled around and I found out the method SendIput().

It works fine if I try to send keypress to notepad.exe but nothing happend when I tried to games.
I checked this site, and I edited my code a little bit but still I don't get any of keypress event from the game.

Can anybody can help me with this?

I used Python but since I imported ctypes module, c/c++ explanation is okay.

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

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

发布评论

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

评论(1

这样的小城市 2024-08-24 20:04:10

看来您正在寻找 Python 答案,但我个人会尝试使用 AutoHotkey。它的脚本语言虽然丑陋,但很容易使用。有论坛帖子(战锤论坛和 AutoHotkey 论坛上)表明其他战锤玩家正在使用 AutoHotkey。

It seems you are looking for a Python answer, but personally I would try using AutoHotkey. Its scripting language is on the ugly side, but rather easy to use. There are forum posts (both on Warhammer forums and AutoHotkey forums) to indicate that other Warhammer players are using AutoHotkey.

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