Jump to content

Checking if any key is pressed

Recommended Posts



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!

Share this post

Link to post
Share on other sites

Oh my gosh, Hime. I just had to jack-knife an event yesterday to avoid the exact scenario you outlined. This script is amazing~ Thank you!  :D

(Also: I really love your avatar! Looks great! <3 )

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

Top ArrowTop Arrow Highlighted