Checking if any key is pressed
Recently I had needed a way to determine whether any key was pressed on the keyboard. This was because any key could potentially be used as an event trigger, and I didn't want to assume anything about what those keys might be.
Without this check, the other safest way was to constantly execute the relevant methods, which may lead to reduced performance given a sufficient number of events on the map. Then I remembered there was a keyboard script available, which showed how to check the state of every key.
Using this idea, I could simply check if any of the keys were pressed, and set a flag as needed, and then provide that as a convenient script call.
Get the script at HimeWorks!
本贴来自国际rpgmaker官方论坛作者:Tsukihime处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/checking-if-any-key-is-pressed.33663/
页:
[1]