将输入发送到直接输入(如游戏)
我正在尝试模拟使用直接输入的游戏的按键。
我用谷歌搜索了一下,找到了 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您正在寻找 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.