[VB]窗口模式下游戏的AutoHotKey应用程序 [英] [VB] AutoHotKey Application for Games in Window Mode

查看:75
本文介绍了[VB]窗口模式下游戏的AutoHotKey应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我打算为一个游戏编写一个小型的AutoHotKey应用程序.

例如,我制作了一个带有名为"START"的按钮的GUI.当按下该键时,将模拟相应的击键.就像可以说,按下A,B,C,D和E就像模拟真正的按键一样,并且被游戏读取为真正的按键.

我正在玩My.Computer.Keyboard.SendKeys("ButtonName",True)代码,并用记事本尝试了一下,以查看是否模拟了击键,是的.现在,我的问题是延误.我如何设置延迟,比如说下一个延迟2秒 击键是模拟的吗?然后是下一个.

我希望您能理解这一点,在此先非常感谢.

解决方案

可以使用

使用SendKeys. SendWait 将击键或击键组合发送到活动应用程序,并等待处理击键消息.您可以使用此方法将击键发送到应用程序并等待任何 由击键启动的要完成的过程.如果其他应用程序必须先完成才能继续运行,这可能很重要.

或使用计时器.


Hi and Good Day to all, i am planning to program a small AutoHotKey Application for a Game. 

For example, i make a GUI with a button named "START" and when it is pressed a corresponding keystroke is emulated. like lets say pressing A, B, C, D and E are emulated just like a real keystroke and is read by the game as a real key press. 

i was playing with the My.Computer.Keyboard.SendKeys("ButtonName", True) code and tried it with notepad to see if the keystroke was emulated, and yes it was. now, my problem is the delay. how can i inset a delay let's say 2 sec before the next keystoke is emulated ? and then the next one too.

 i hope you understood this, thank you very much in advance.

解决方案

Either use

Use SendKeys.SendWait to send keystrokes or combinations of keystrokes to the active application and wait for the keystroke messages to be processed. You can use this method to send keystrokes to an application and wait for any processes that are started by the keystrokes to be completed. This can be important if the other application must finish before your application can continue.

or use a timer.


这篇关于[VB]窗口模式下游戏的AutoHotKey应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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