See
the remarks here[
^]. This is not an ideal function for your project, since the code will run much faster than the change in keystate. I am not sure exactly what you are trying to do, but some simple input from the console will most likely satisfy your requirements.