让我的应用程序正常工作,而另一个进程是焦点(游戏的自动人行道) [英] Make my app working, while another process is in focus (autowalker for a game)

查看:86
本文介绍了让我的应用程序正常工作,而另一个进程是焦点(游戏的自动人行道)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想写一个小应用程序,让我的视频游戏角色自动走按W。



让我说我有一个游戏运行过程game.exe

在玩游戏时我想按一些热键。 (例如CTRL + NUM或其他任何东西)



这应该通过一直发送W-Key来切换我的自动跟踪。

这是不知怎的可能?



我尝试过:



说实话,并不多,因为我不知道如何实现它。

Hi guys, i wanted to write a small app, that lets my Videogame-Character walk automatically by "pressing W".

Lets say I have a game running the the process "game.exe"
While playing the game I want to press some Hotkey. (For example CTRL+NUM or anything)

This should toggle my autowalking by sending the W-Key all the time.
Is this somehow possible?

What I have tried:

To be honest, not much because i have no idea to realise it.

推荐答案

为什么要一直发送W?如果用户重新键入键盘输入会因为无法轻松使用WASD键会发生什么?



请勿这样做。

相反,让向前走键处理程序调用一个执行实际行走的WalkSteps方法。然后你的自动步行功能只是启动一个计时器,当它打勾时调用相同的方法。结果:自动行走,没有键盘消息不必要地飞到任何地方。
Why would you want to send "W" all the time? What happens if the user remaps the keyboard inputs because he can't use the WASD keys comfortably?

Don't do that.
Instead, make the "walk forward" key handler call a WalkSteps method that does the actual walking. Then your "auto walk" function just sets off a Timer that when it ticks calls the same method. Result: auto walking without keyboard messages flying everywhere unnecessarily.


这篇关于让我的应用程序正常工作,而另一个进程是焦点(游戏的自动人行道)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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