首页 > 解决方案 > 在lua中按住一个键

问题描述

是否可以在lua中按住一个键,例如'a'?我不是说用 doKeyPress(VK_A) 按下键然后循环它,而是实际按住它一段时间。

标签: luakeypresscheat-engine

解决方案


你想要的是keyDown()相反。

https://wiki.cheatengine.org/index.php?title=Lua:keyDown

你最终会想要执行一个keyUp()命令来释放它。

https://wiki.cheatengine.org/index.php?title=Lua:keyUp

通过触发事件(您自己的键或鼠标单击)
或在指定时间后使用计时器来 keyUp()。

编辑:

https://wiki.cheatengine.org/index.php?title=Lua:sleep

keyDown(VK_A)
休眠(5000)
keyUp(VK_A)


推荐阅读