I'm using AutoIt to write a program that will measure a person's reaction time. The user will be asked to hit a specific random number (0 - 9) on the keyboard, and the program will measure the speed with which the user presses the key.
Here is a function from the AutoIt program:
If _IsPressed('1b') = 1 Then Return(0) ;1b is ESC
If _IsPressed($a) = 1 Then Return(1)
This function works, but it doesn't quite do what I want it to do.
I want the function to return a zero if the user hits the wrong
number key, not just if the user hits "Esc". I suppose I could write a long "Select / Case" statement (which would cover all ten possible cases), but I wonder if there is an easier or more elegant way to accomplish this goal.